A computer malfunction on a passenger plane showed information it was flying near the North Pole rather than north of Spain and bound for Edinburgh.
The fault on the Boeing 737-8AS, which occurred while cruising on autopilot at 36,000ft, also caused the aircraft to climb by 600ft.
The crew was aware of where the plane was flying and a separate system was showing its correct position.
The pilots took manual control and the plane was landed safely at Edinburgh.
Six crew and 177 passengers were on the flight from Portugal in October 2018.
The false information show up on a system used by the pilots.
The crew was well aware of where the aircraft was and another GPS-equipped computer system was correctly showing its actual position.
A newly-published Air Accident Investigation Branch (AAIB) report said the plane's attitude indicator malfunctioned and this affected "numerous aircraft systems".
The false position information led to incorrect details showing on the aircraft commander's main flight display and the autopilot responded by "initiating a slow climb".
The failure happened at 22:05 on 9 October while the aircraft was over the Bay of Biscay and en route from Porto Airport in Portugal to Edinburgh.
The AAIB said the aircraft made a safe and "uneventful" landing at the Scottish airport.