Egypt formally asked Cyprus on Wednesday to extradite a detained Egyptian man who authorities say admitted hijacking a domestic EgyptAir flight and diverting it to Cyprus by threatening to blow it up with a fake explosives belt.

The legal developments came as those on board described an unnerving situation in which the hijacker looked for foreigners by sorting through their passports and kept five on them on the plane after freeing the non-Western passengers.

"He wanted the foreigners ... only foreigners. He didn't want Egyptians or double nationalities," flight attendant Rouida Ihab told The Associated Press.

Italian passenger Andrea Banchetti said passengers were calm through the ordeal but admitted "(I was) going out of my mind" when the hijacker let non-Western passengers off the plane, leaving behind only five European passport-holders including himself.

"We looked each other in the eyes and we said, `Here we are. We're at the end of the line. It's over,"' the 47-year-old mechanic told the Rome daily La Repubblica.

The extradition request from Egypt's General Prosecutor Nabil Sadek came shortly after a Cypriot court ordered Wednesday that the suspect, identified as 59-year-old Seif Eddin Mustafa, remain in police custody for eight days to assist the hijacking investigation.

Police prosecutor Andreas Lambrianou said the suspect faces preliminary charges including hijacking, illegal possession of explosives, kidnapping and threats to commit violence.

Judge Maria Loizou said she approved the police request for the maximum eight-day detention because of fears that the suspect might flee and because he admitted to the hijacking in a voluntary statement to police.

Tuesday's hijacking, which started when authorities said Mustafa claimed to have explosives in a belt and forced a flight from Alexandria to Cairo to land in Cyprus, ended peacefully about six hours later. Most of the 72 passengers and crew aboard the Airbus A320 were released soon after the plane landed, although a handful were held for longer. All were let go before Mustafa was arrested when he tried to flee on foot after leaving the plane, police said.

Lambrianou said after Mustafa was arrested, he told police: "What's someone supposed to do when he hasn't seen his wife and children in 24 years and the Egyptian government won't let him?"

Egypt's interior ministry said Mustafa had a long criminal record but had finished serving a one-year prison term in March 2015. An official at the general prosecutor's office, speaking on condition of anonymity because he was not authorized to speak to the press, said there was no travel ban on Mustafa.

A Cypriot police official told the AP that Mustafa's criminal record on the island stretched back to 1988, when he was convicted on six counts of forging passports and handed a suspended sentence. He was later deported to Egypt following domestic violence charges by his then-Cypriot wife.

He re-entered Cyprus on an assumed Qatari identity, but was tracked down and again deported to Egypt in 1990. Mustafa and his Cypriot wife divorced in 1994. The couple had four children but one child has since died, according to a relative who didn't want to be named discussing family matters.

The police official spoke on condition of anonymity because he's not authorized to discuss details of an ongoing investigation.

After the hearing Wednesday, a handcuffed Mustafa flashed the "V" for victory sign out the window of a police vehicle as he was driven away from the Larnaca court house.

Cypriot officials had described Mustafa as "psychologically unstable" following a bizarre set of demands he made to police negotiators, including what Lambrianou said was a letter he wanted delivered to his Cypriot ex-wife in which he demanded the release of 63 dissident women imprisoned in Egypt.

Lambrianou said 15 minutes into flight MS181 Mustafa demanded that the aircraft be diverted to an airport in Greece, Turkey or Cyprus. Despite an initial refusal from Cypriot authorities, the plane eventually landed in Larnaca after the pilots warned about low fuel.

The police prosecutor said witnesses saw Mustafa wearing a white belt with pockets that had cylindrical objects stuffed inside. Wire protruding from the cylinders led to what appeared to be a detonator in his hand.

Among those forced to stay on the plane longer was Ben Innes, a British man pictured in a photo with Mustafa that quickly made the rounds on social media.

Innes told The Sun newspaper he wanted to take "the selfie of a lifetime" while the incident was unfolding. The bizarre photo, taken by a member of the cabin crew and shared on social media, shows him smiling next to Mustafa, who has his jacket open to reveal the fake explosive belt.

"I figured if his bomb was real I'd nothing to lose anyway," Innes, 26, told the newspaper in a story published Wednesday. He told The Sun he had been texting his mother throughout the ordeal.

Banchetti told La Repubblica he should have "slapped" Innes for taking that photo.

"That guy could have had a potato in his belt, but how do you go up to him that way and take a photo of him?" said Banchetti. "'Are you a fool?' I said in English."

Mustafa had threatened to detonate the belt if police attempted to "neutralize" him, Lambrianou said, but he eventually gave up after the crew and passengers were released.

Banchetti told the Milan daily Corriere della Sera that he told Cypriot police the "haphazard tangle of things" that was the hijacker's alleged explosive belt seemed fake.

Lambrianou said no explosives were found in the belt, except for a container filled with an unidentified liquid. Police also found an unidentified liquid in the suspect's bag. The allegation regarding explosives could be dropped if the liquid found with Mustafa is not explosive material.

The prosecutor said Cypriot authorities will Interpol to help determine how the suspect managed to get the fake belt through Egyptian airport security.