A transatlantic flight carrying 326 passengers and 11 crew had to divert after one of the pilots spilled coffee on the controls, causing audio equipment to produce a burning smell, smoke and even a button to melt.

It happened February 6 aboard a Condor Airlines Airbus A330-243 over the North Atlantic traveling from Frankfurt, Germany to Cancun, Mexico.

According to the Air Accidents Investigation Branch report, a crew member brought a cup of coffee into the cockpit but did not put a lid on it. This was not unusual for the flight and the report noted that the cups used on the flight did not properly fit into the provided cup holders.

RELATED: Dashcam video shows pilot make emergency landing on highway

RELATED: Turbulence forces Air Canada flight to land in Hawaii

The cup was put on a tray, the report says. At some point, the cup was knocked over and onto the flight commander's lap and audio control panel (ACP), causing it to fail. The co-pilot's ACP later failed as well.

"During the failures, the ACPs became very hot and produced an electrical burning smell and smoke," the report reads. A button on the co-pilot's ACP unit overheated and caused one of the buttons to start melting.

The flight was diverted to Shannon, Ireland, as a precaution. Because of the smoke in the cockpit, one pilot remained on oxygen at all times, but the smoke eventually stopped. The ACP failure meant the commander was not able to receive or transmit and could only hear transmissions through the co-pilot's speaker.

The report states Condor is now requiring cup lids to be provided on all routes and said it would look into making sure there would be cups on future flights that will fit the cup holders.