A private plane in Florida flew within two nautical miles of Air Force One while US President Donald Trump and First Lady Melania Trump were on board, breaching guidelines and sparking an investigation.

The mid-air scare on Friday (3 February) took place as the couple travelled to the president's Mar-a-Logo resort in Palm Beach, Florida. According to protocol, all planes under the supervision of air traffic control are supposed to be separated by a minimum three nautical miles when in flight, or five miles at high altitudes.

The "loss of separation" occurred around 30 miles from Palm Springs International Airport. The two aircraft were so close that the pilots made parallel visual contact with one another, ABC News reported.

However, both pilots were in touch with air traffic controllers at all times and never at risk of collision.

The president's specially-designed Boeing 747 landed safely a few minutes later at 4.40pm local time, according to Bloomberg.

Most "loss of separation" incidents are caused by pilot error or controller error. Although the president's aircraft, known as the "flying White House" was never in danger, the incident will nevertheless be subject to an investigation by the Federal Aviation Administration (FAA) and, potentially, the National Transportation Safety Board.

The identity of the private plane's pilot has not been revealed.

Air Force One has been specially adapted to make it safe from almost any contingency. This includes jamming mechanisms to prevent it being hacked and secure communications equipment so it could operate as a mobile command centre in the event of a nuclear attack.

Trump Mar-a-Lago
US President Donald Trump with wife Melania after he arrived on Air Force One at the Palm Beach International Airport for a visit to his Mar-a-Lago Resort on 3 February 2017 Joe Raedle/Getty Images

The plane has a medical centre, conference suite within its three levels. It can be refuelled in midair, meaning the president can in theory be taken anywhere on earth.