A passenger on a Lufthansa flight is being called a hero after he was able to safely land a plane at Dublin Airport after the co-pilot became sick.

The co-pilot of a Lufthansa Boeing 747 had a migraine headache that left him incapacitated. When the cabin crew announced that the plane from Newark to Frankfurt, Germany was being diverted to Dublin, an off-duty pilot, who happened to be among the 264 passengers on board, stepped up to the cockpit. 

When the German off-duty pilot heard that the plane was being diverted, he asked a crew member why the diversion was taking place.  The man said he was a licensed pilot and he helped the captain make the emergency landing in Dublin around 6am on Monday.

"It was a miracle. It had all the elements of a Hollywood movie but thankfully one with a happy ending," a source told Independent.ie.

"In such circumstances it's absolutely normal procedure for the pilot, the flight captain, to continue to operate the aircraft," a Lufthansa spokeswoman said, according to the Daily Mail.

"Also, where necessary, the cabin crew are fully trained and can be called upon to read checklists back to the pilot. The procedures are in place for such an eventuality. But the effort of the off-duty pilot were certainly appreciated," she continued.

The Irish Aviation Authority was notified about the issue and was given a report. The Air Accident Investigation Unit (AAIU) of Ireland's Department of Transport was also notified and is investigating the issue.

Although the man's services were appreciated, Lufthansa said the plane would have been able to land safely with or without the help of the off-duty pilot.

"Whenever you have any sort of medical issue on board, whether it's a doctor or appropriately qualified person, that's always appreciated. The flight would have been operated as per procedures and safely even if the off-duty pilot had not been there," the Lufthansa spokeswoman added.