A different American Airlines flight. (LM Otero/AP)

An American Airlines flight departing Reagan National Airport on Friday afternoon was diverted to Dulles International Airport due to an unusual odor in the cockpit, according to the airline.

Flight 1227, a Boeing 737, left National Airport for Miami International Airport at 5:05 p.m. But due to “an electrical odor of some kind,” the plane was diverted to Dulles as a precaution, said Matt Miller, a spokesman for American Airlines.

It landed safely at Dulles at 5:55 p.m., Miller said. Mechanics will inspect the plane before determining what to do next and how to get the flight’s 150 passengers to Miami.

The plane diverted to Dulles because that airline has longer runways, which is why planes often opt to land at Dulles after diversions, Miller said.