Investigators are trying to figure out how an accused rapist was able to get past security with a stun gun at John F. Kennedy Airport in New York. Luckily the man never made it on to his plane to London.

Prodromos Vasilopoulos, 23, had allegedly used the stun gun to control and rape his 19-year-old ex-girlfriend on Tuesday. He tried to fly out to London on Wednesday, but he was later arrested, ABC reports.

Vasilopoulos, who is from Greece, was about to board his flight when Port Authority police and Customs agents took him into custody at the request of New York City's special victims unit.

"During the course of conducting an inventory of the suspect's bags while at the gate, PAPD officers discovered a weapon that may have been used in the commission of the alleged crimes," the Port Authority police said in a statement according to ABC.

The weapon was a strong 3,800-watt stun gun. The weapons are not allowed in carry-on luggage but they can be checked.

The Transportation Safety Administration is now looking into the issue as Vasilopoulos was able to get past the security checkpoint without being detected.

"TSA takes this incident seriously and will carefully review the details," a spokesperson told ABC.

Police believe Vasilopoulos had used the weapon in an attack on his ex-girlfriend in her apartment in Queens, New York.

According to Queens District Attorney Richard Brown, the woman received a UPS package and then heard a knock on the door as someone said "wrong delivery."

When she opened the door, the man shocked her with the stun gun. She started screaming and Vasilopoulos "shoved his fingers into her mouth to muffle the sounds." She fell to the floor and he used the stun gun on her again. He then brought her to her bedroom, where he beat her, attempted to strangle her, and raped her repeatedly.

The victim went to the hospital and was given a rape kit. She was also treated for several injuries.

Vasilopoulos was trying to go home to Greece when investigators found that he was bound for a flight to London, with a connecting flight to Greece.

Vasilopoulos was charged with predatory sexual assault, criminal possession of a weapon and harassment for allegedly threatening that the woman "would pay for breaking up with him," according to Brown.