An easyJet flight carrying 167 passengers to the UK was one second away from disaster after the pilots misjudged the runway's length by almost a mile.
The Airbus A320 took off from Lisbon Airport with just 110m (361ft) of tarmac remaining after the crew members used the wrong calculations for the runway they used.
Based on the speed it was travelling, in another 1.3 seconds the aircraft would have reached the end of the runway, according to a report by the Air Accidents Investigations Branch (AAIB).
"This could have caused significant damage to the aircraft and its occupants," the report said.
Before the flight to Manchester took-off on 16 September, the pilots carried out calculations for runway 21 at Lisbon Airport but mistakenly used the full length of the runway to make their assessment, according to the AAIB.
Instead, the pilots should have used measurements from the intersection on the runway which they used - a difference of 1,395m (4,577ft) from the full length of the runway, it added.
This meant that when the aircraft was cleared for take-off, the wrong calculations were used to get the plane airborne and threatened the safety of the aircraft, the AAIB said.
According to the report, the pilots noticed there was something wrong as they saw the red and white alternate lights of the last 900m (2953ft) of the runway but they did not select takeoff/go-around thrust.
The fence at the end of the runway was cleared by the aircraft by just 35ft (10.6m).
Both pilots were "interrupted numerous times during the pre‑flight preparation", which the report says contributed to the mistakes they made.
It was not the first time this has happened at the airport, with two similar incidents within two weeks of each other in April and May 2019.
A number of changes were made to the labelling of the runway in December and in January, a recommendation was made to "discontinue the use of takeoff positions... [to] minimise confusion concerning takeoff points".
An easyJet spokesperson said: "The pilots followed normal procedures for take-off and the flight took off without incident.
"The safety of our passengers and crew is always our highest priority and we will always take action to ensure we maintain the highest standards of safety.
"We continue to work with industry partners to review possible technical developments, including software updates referenced in the report that we have already taken action on, to help prevent a recurrence of these types of events."