NEW YORK (AP) — Five people who were being held hostage during an apparent robbery attempt at a home in Queens were released by two armed men, who surrendered peacefully to police early Wednesday, authorities said.

The roughly five-hour standoff began after officers surrounded the home Tuesday night. A woman with a young child had reported that two armed men were inside, Assistant Chief Ruben Beltran told reporters at the scene.

Five people were released unharmed during police negotiations with the men, the New York Police Department’s public information office said. The men were taken into custody about 2 a.m.

Their names weren’t immediately released, but police identified them as being 35 and 51 years old. Police said they also recovered two guns from the scene. Formal charges were pending early Wednesday.

Police Commissioner Dermot Shea praised the officers for taking the suspects into custody without a shot being fired. Shea tweeted, “Great work by your police!”