After a standoff lasting several hours, the hijacker walked down aircraft steps and surrendered to Cypriot security forces.

Shortly before that, several people were seen fleeing the aircraft, including one person, apparently a crew member, who climbed out of a cockpit window.

Other passengers had left the plane after appearing to have been released.

Earlier, Cypriot President Nicos Anastasiades had responded to a reporter’s question about whether the hijacker was motivated by romance, by laughing and saying: “Always there is a woman involved.”

EgyptAir said the Airbus A320 was carrying 56 passengers from Alexandria to Cairo, along with six crew and a security official.

A statement from Egypt’s civil aviation ministry said 26 foreign passengers were on board, including eight Americans, four Britons, four Dutch citizens, two Belgians, two Greeks, a French national, an Italian and a Syrian.

Larnaca airport, on the south coast of Cyprus, has been closed and scheduled flights diverted elsewhere.