An Egyptian man who hijacked an EgyptAir plane during a routine domestic flight to Cairo and forced it to land on the island of Cyprus on Tuesday has surrendered and was taken into custody after he released all the passengers and crew. His surrender ended an hours-long drama and standoff at the Larnaca airport in southern Cyprus. The hijacker had earlier freed most of the passengers but kept seven people — four crew members and three passengers — with him. Just minutes before the arrest, local TV footage from the airport showed several people disembarking from the aircraft and a man who appeared to be a crew member climbing out of the cockpit window and sliding down the side of the plane. Alexandros Zenon, the permanent Secretary of the Foreign Ministry in Cyprus, confirmed the hijacker's surrender and subsequent arrest, saying the situation was "over." The arrest was also reported by Egypt's prime minister, Sharif Ismail, and Civil Aviation Minister Sharif Fathi. "All passengers and crew are safe," Fathi said on state television. The man's motivation was unclear, but Cyprus President Nicos Anastasiades said the hijacking was "not something that has to do with terrorism" and a Cyprus government official, speaking on condition of anonymity to discuss an ongoing investigation, said the man "seems (to be) in love." Anastasiades, appearing alongside European Parliament President Martin Schulz in Nicosia, was asked by reporters whether he could confirm that the incident was about a woman. "Always, there is a woman" involved, he replied, drawing laughter. A Cyprus police official, speaking on condition of anonymity because he's not authorized to disclose details of the situation, says the hijacker walked off the plane and was taken into custody by special anti-terrorist police. The official said the man wore a belt but there were no explosives in it. The Cypriot woman who the hijacker had asked to speak to is his former wife with whom he has four children, the police official said. A civil aviation official, also speaking on condition of anonymity because he wasn't allowed to talk to the media, said the man gave negotiators the name of a woman who lives in Cyprus and asked to give her an envelope. It was not clear if she was his former wife. The flight MS181 took off from the Mediterranean coastal city of Alexandria on Tuesday morning en route to Cairo with at least 55 passengers, including 26 foreigners, and a seven-member crew. An official with flight-tracking website FlightRadar24 said the plane showed no immediate signs of distress. The flight between Alexandria and Cairo normally takes about 30 minutes. There was also confusion about the hijacker's identity. At a news conference in Cairo, Egypt's Civil Aviation minister, Sharif Fathi, refused to identify him. Earlier, Egyptian government spokesman Hossam Al-Queish said the hijacker was Ibrahim Samaha, but an Egyptian woman who identified herself as Samaha's wife said her husband is not the hijacker and was on his way to Cairo so he could fly to the US to attend a conference. The woman, who identified herself only as Nahla, told the Egyptian private TV network ONTV in a phone interview that her husband had never been to Cyprus and that a photo on Egyptian and regional TV channels that supposedly showed the hijacker was not him. Later, the official Middle East News Agency gave a different name for the hijacker. Egypt's state news agency, MENA, later identified the hijacker as Seifedeen Mustafa. The name was confirmed by a senior Cypriot official. Al-Queish, the government spokesman, also told the private CBC TV network that authorities could not confirm that the hijacker had explosives on him. An earlier statement from the Egyptian Aviation Ministry said the man claimed he had a belt with explosives. The plane landed at the airport in the southern Cypriot city of Larnaca, also on the Mediterranean. A statement from the Egyptian Civil Aviation Ministry statement said the foreigners on board included eight Americans, four Britons, four Dutch, two Belgians, a French national, an Italian, two Greeks and one Syrian. Three other foreigners could not be identified. The initial batch of passengers released by the hijacker were seen calmly walking off the plane down a set of stairs, carrying their hand luggage, and boarded a bus parked by the plane's side. Security was tight at the airport, with police repeatedly pushing back reporters and TV news crews working just outside the facility's fence, near where the aircraft stopped. Police also evacuated the nearby Makenzy beach, a stretch of coast close to the airport and popular with tourists. It was not immediately clear why. An Egyptian aircraft was expected to later fly to Larnaca so it could bring back the released passengers, according to officials. The hijacking was reminiscent of a deadly 1978 incident that involved Egyptians, planes and Larnaca airport. The incident arose when two Palestinians assassinated an Egyptian government minister at his hotel in Nicosia. The assailants took hostages and drove to the airport, where they boarded a plane with them. They later returned to Cyprus, where they had an hours-long standoff until an Egyptian C-130 carrying commandos landed at Larnaca airport. The commandos attempted to storm the Cyprus Airways jet, but were fired upon by Cypriot troops. Many were killed. The Palestinians eventually surrendered. They were arrested, sentenced and released years later. The incident poisoned Egypt's relations with Cyprus for years. Relations eventually improved, but it was Egyptian President Abdel-Fattah El-Sissi, in office since June 2014, who has forged close ties with Cyprus.