Mr. Koch said the floating jails were needed if the city was to get serious about cracking down on crime.

“We have to have jails in which to put them, and we dock a jail barge alongside a neighborhood, there are opponents,” Mr. Koch said in a speech in 1989. “I say to these groups, ‘Would you rather have these people walking around in your neighborhood, or be in jail on a barge in your neighborhood?’”

The Bain Center was pulled by tugboats — it does not have motors — to Hunts Point, after the city had considered but dismissed other locations, including the Brooklyn Army Terminal and near Gracie Mansion, the mayor’s home on the Upper East Side of Manhattan, but area residents rose up in protest.

But by the time the Bain Center arrived, the city’s jail population was declining and the city soon announced it would remove and likely sell two of the floating jails , one off Greenwich Village and the other near the Lower East Side, to a company that said it was going to turn them into scrap.

In the years since it opened, the Bain Center has stayed relatively the same. Inside, the walls and ceilings are still colored an off-white gray. The barge sways with the waves. Inmates can exercise on the top floor inside a caged-enclosed recreational area that has views of Rikers Island. From their cells , inmates can look out through tiny portholes.

“Rikers, in all its gory details, still had benefits over the barge,” said Mr. Mayfield, who spent 10 months between 2008 and 2009, at the Bain Center because he could not afford bail regarding his drug-possession charge. “One of those benefits was mobility and being able to move around and being able to go outside.”

Mr. Mayfield, who at age 57 is taking undergraduate classes at Columbia University on a scholarship, said he would never forget sweltering summer days inside the barge jail, breathing in steamy, acrid air.