When the captain lost consciousness, the first officer took over and piloted the aircraft to the closest airport, he said.

A doctor on board the airplane treated the pilot until it landed in Portland and medical personnel arrived, he said.

The captain was likely suffering from food poisoning or the flu, Alaska Airlines said Friday. The condition of the captain was not immediately available, but he “is doing better today,” airline spokeswoman Bobbie Egan said.

There were 116 passengers and five crew members on board the plane, which landed in Portland without incident, according to the airline.