A military plane has declared an emergency while flying above Scotland.

The RAF Hercules aircraft, with flight number ZH870, was flying above Perth when it released the Squawk 7700.

An emergency squawk is used to identify an aircraft which has a possible issue and enables it to have priority over other air traffic.

In this instance, it was confirmed to The Herald that the plane had suffered a technical issue during a routine training exercise.

READ MORE:Ā Mysterious military plane spotted over Glasgow during coronavirus lockdown

It had taken off from the RAF's base in Brize Norton base in Oxfordshire at around 3.10pm, according to FlightAware.

After declaring the emergency, it returned to the base, with the crew onboard confirmed to be safe and well.

An RAF spokeswoman said:Ā ā€œAn RAF Hercules C130 from RAF Brize Norton suffered a technical issue on a routine training sortie this afternoon, the aircraft recovered safely to base and all the crew are fine."