NEW YORK (CNN) -- Charges have been dropped against four men accused of raping an 18-year-old student at Hofstra University after the woman recanted her allegations, prosecutors said.

A Hofstra University student recanted her claims that she was lured to a dorm and assaulted in a bathroom stall.

A judge dismissed all charges Wednesday night and ordered the release of the four men -- Jesus Ortiz, 19; Stalin Felipe, 19; Kevin Taveras, 20; and Rondell Bedward, 21; all of the New York metropolitan area, according to Nassau County, New York, District Attorney Kathleen Rice.

They had been arrested, arraigned and jailed, with bail set at $500,000 each. Each was facing five counts of first-degree rape.

"Late this evening, during the continuation of the Nassau County Police Department's investigation of the allegation, and under questioning by my office's chief trial attorney and chief sex crimes prosecutor, the alleged victim of the sexual assault admitted that the encounter that took place early Sunday morning was consensual," Rice said.

She said her office has launched a criminal investigation into the statements and reports given by the woman.

The student had told Nassau County police that she had been lured from a club, forced into a men's bathroom at a university dormitory, bound and assaulted.

The woman then called the university public safety office, which alerted local police.

The reported rape shocked the Hofstra University community. The university had announced that it was increasing safety patrols on campus, as well as establishing a support hotline for students and parents.

All About Criminal Assault • Hofstra University