NEW ORLEANS (AP) - Videos showing inmates at the New Orleans jail apparently using drugs, drinking beer, gambling with cash and possessing at least one large handgun were shown Tuesday during a hearing in U.S. District Court, accompanied by another video purportedly showing one of the inmates walking Bourbon Street.

The recordings, believed to be shot by inmates, were aired during the second day of hearings on a proposed agreement between the Justice Department and Sheriff Marlin Gusman to improve conditions at the Orleans Parish Prison. It was unclear when they were recorded.

The video was allowed into evidence by U.S. District Judge Lance Africk at the behest of lawyers for the city who oppose the agreement, citing its potential costs to the city, and who have been highly critical of Gusman's operations of the jail.

Released to reporters at midday Tuesday, the images are shaky at times, but clear. One cuts from a neighborhood scene of women and children on a street to a scene inside the jail, with inmates smoking, swallowing, snorting and injecting what are believed to be drugs. Cash changes hands during a jail cell dice game. Some inmates drink from cans of beer. Cell phones are visible.

One inmate ejects bullets from a large handgun.

"You can get what you want in here," a prisoner is heard saying in the background. "Medication. Pills. Drugs. Heroin."

Another video shows a man strolling up and down Bourbon Street, peering into strip joints, occasionally chatting with passing police on patrol and at one point looking at the recorder and saying: "Y'all know I'm supposed to be in jail right now." It is unclear whether that video was shot the same night or how the man had gotten out of jail if he was, indeed, supposed to be in the lockup.

It's unclear when the videos were recorded. Testimony and a news release from Gusman indicate the jail scenes took place in an area of a building on the Orleans Parish Prison campus known as the House of Detention, now closed.

"The House of Detention is a city-owned building in a state of disrepair and abhorrent lack of proper security measures. I closed the House of Detention last year because of these problems," Gusman's statement said. It added that the building was only in use at the time because of damage to other buildings in Hurricane Katrina.

Manny Romero, a prison consultant testifying for the Southern Poverty Law Center and the Justice Department, said after viewing the video that he had never seen such dysfunction in a jail. He said the amount and nature of some contraband - including cash, cellphones, drugs and weapons - suggests prisoners may have had help from jail staff in obtaining it.

"It was obvious that they were aware that staff does not go into these units frequently," Romero said under questioning from Justice Department lawyer Matt Donnely.

The video was introduced at the request of city officials who oppose the consent decree and also are trying to get out of a separate agreement on reform of the New Orleans Police Department. That agreement was approved by a federal judge in January, but the city argues the separate jail agreement was negotiated without the city's knowledge and that both agreements threaten to bust the municipal budget.

In a statement late Tuesday, Mayor Mitch Landrieu said, "How can we make our city safe when prisoners are coming and going from jail as they please, walking freely on the streets and then returning to jail with heroin, cocaine, and loaded weapons?

"This tape was hidden away from the public in a safe in the Sheriff's Office and only came to light when the City's legal team fought to uncover it."

While not disputing the need for improvements at the jail, Landrieu has said the city was left out of negotiations for the sheriff's department's consent decree, and that the cost - by some estimates as much as $22 million annually - could undermine public safety by forcing funding cuts for police and other vital services.

City officials have suggested in court filings that a federal receiver should be appointed for the jail, rather than handing more money over to Gusman.

"I cannot in good conscience cut vital services or raise taxes to put even more money into an office where waste, fraud, and abuse run rampant. The only way to fix the problem is to put a federal receiver in place that will run a safe and secure jail in a financially responsible way," Landrieu's statement said.

The sheriff is an elected official with limited police powers. Most policing of city streets is done by the Police Department under Superintendent Ronal Serpas, who was appointed by Landrieu.

(Copyright 2013 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.)