The bird of prey became stuck on the third storey of Birmingham's Queen Elizabeth Hospital since Friday after chasing a pigeon into a courtyard, the fire service said.
The RSPCA worked with firefighters to free the bird using a net.
The falcon was liberated from its predicament at about 17:30 on Saturday and was examined by a vet before being reunited with its mate.
Hospital staff said it had became trapped halfway up the six-storey interior courtyard area, which is not accessible to the public.
The falcon was reported to the fire service by a member of the public who spotted it from a ward.
The RSPCA said the male falcon had made several attempts to free itself.
"Witnesses said they saw him attempting to fly out but he ended up hurtling repeatedly against the windows before falling back down to the bottom," the charity said.
RSPCA Inspector Boris Lasserre said the bird was eventually rescued with the help of a net, which had to be dismantled to allow the bird to be reached.
"By chance one of the fire officers on duty, Nigel Hawkins, was an expert falconer," he said.
"The bird was resting on a small ledge by a window.
"This window could only be opened a few inches. We took the net and pole apart so it could fit through the narrow gap.
"Mr Hawkins gently edged the net nearer the bird so as not to frighten him away beyond reach. He was then able to very gently place the net over the bird."
He added the bird was one of a nesting pair which live at the hospital.
The hospital said it was "pleased" the falcon had been rescued.
"People get a bit worried about trapped birds so it's good news," a representative said.
The fire service said: "Although we do a lot of animal rescues, we haven't been involved in anything like this before."
A peregrine falcon which became trapped on a hospital balcony has been rescued.