Image copyright Reuters Image caption The airline have named the pilot as first officer William "Mike" Grubbs

A pilot died on Wednesday during a flight from Dallas to Albuquerque, New Mexico, American Airlines have confirmed.

The Boeing 737-800 was two miles from landing when the captain declared a medical emergency, an Albuquerque airport spokesman confirmed.

"They landed without incident, taxied to the gate and were met by medical personnel," he told the Albuquerque Journal.

None of the passengers was injured.

American Airlines confirmed the pilot's identity as first officer William "Mike" Grubbs.

US media quoted airline spokeswoman Polly Tracey as saying: "We're taking care of first officer Grubbs' family and colleagues and our thoughts and prayers are with them during this time."

In 2015, an American Airlines pilot died in a medical emergency on an overnight flight from Phoenix to Boston.

The flight was safely diverted by the co-pilot to Syracuse, New York.