A quick-thinking air traffic controller averted a potential disaster on Friday after noticing two American Airlines jets were mistakenly flying the same flight number.

Audio of the incident shortly after midnight Friday shows how the Phoenix controller found a solution to ensure the planes that were both called American 2482 maintained proper separation as one plane arrived from Chicago shortly after the other had taken off.

“I’ve been working air traffic for 25 years. I’ve never seen two aircraft pretty much merge with the same call sign. That’s pretty incredible,” the controller said after the departing plane had safely cleared the area.

If both pilots thought the controller was telling them to fly at the same altitude as they headed toward each other, they might have collided.

Therefore, it was crucial that the two pilots knew which plane he was directing.

The audio posted by ATC.com shows how the controller quickly started referring to “American 2482 on the arrival” and “American 2482 on the departure” to keep the two planes straight.

The controller kept the arriving plane safely above the departing plane even as their flight paths converged and made sure that the pilots of both airlines saw each other when they were still miles apart. He also directed the departing plane not to climb too high, so a gap would remain between the planes.

“It could have been disastrous, but I’m glad it worked out,” the controller said afterwards.