Former New York City Mayor Michael Bloomberg took heat from his political rivals Wednesday night for the controversial "stop-and-frisk" policing that was carried out during his time in office.

Vermont Sen. Bernie Sanders opened Wednesday’s Democratic debate in Las Vegas by saying the stop-and-frisk program “went after” African-Americans and Latinos in the city and allowed police to unfairly target minorities.

Former Vice President Joe Biden also criticized Bloomberg on the policy.

Bloomberg didn’t initially mention the policing program but responded by arguing that he was in a better position to defeat President Trump in November. He later acknowledged he was "embarrassed" over his past position, but argued that he was trying to improve public safety at the time.

MICHAEL MOORE SLAMS 'DISGUSTING' DNC FOR CLEARING DEBATE PATH FOR BLOOMBERG: 'BECAUSE HE HAS A BILLION F---ING DOLLARS!'

The former mayor has apologized for stop-and-frisk and said he should have acted faster to stop police from using it, but his campaign has been hounded since its launch with questions over the policy.

Most recently, Bloomberg has been slammed following a newly surfaced recording from a 2015 speech in which he is heard giving a full-throated defense of the controversial policing procedure.

In an audio clip of the 2015 speech Bloomberg gave to the Aspen Institute, the billionaire acknowledged that "stop and frisk" targeted minority "kids" whom cops must throw "up against the wall" to disarm. The Aspen Times reported at the time that Bloomberg representatives asked the Institute not to distribute footage of his appearance.

"Ninety-five percent of murders- murderers and murder victims fit one M.O. You can just take a description, Xerox it, and pass it out to all the cops," he had said. "They are male, minorities, 16-25. That's true in New York, that's true in virtually every city [inaudible]. And that's where the real crime is. You've got to get the guns out of the hands of people that are getting killed."

In a statement released last week, Bloomberg said he "inherited the police practice of stop-and-frisk," which he stressed he "cut" back by 95 percent by the time he left office, but admitted he "should've done it faster and sooner" and that he has "taken responsibility for taking too long to understand the impact it had on black and Latino communities."

CLICK HERE TO GET THE FOX NEWS APP

Bloomberg, who is funding his campaign with hundreds of millions of dollars from his vast fortune, has surged in recent polls as some within the Democrat Party seek a more moderate alternative to far-left candidates such as senators Sanders and Elizabeth Warren, and former Vice President Joe Biden's campaign appears to be in free-fall.

Bloomberg, who succeeded Rudy Giuliani as mayor of America's biggest city and continued to suppress crime, has been repeatedly grilled about his previous support for the "stop-and-frisk" approach to policing.

Fox News' Joseph A. Wulfsohn and The Associated Press contributed to this report.