Former Vice President Joe Biden was grilled Friday about the Obama administration’s record of detaining migrant children in what some lawmakers and activists have described as “cages” -- with the 2020 hopeful claiming the government did it to keep them “safe.”

Biden, who served as VP for both of then-President Barack Obama’s terms, has cited his experience as a reason he should be the Democratic nominee. But with the Democratic Party shifting to the left on matters related to immigration in recent years, he has faced increased scrutiny about the administration’s policies from those claiming they were cruel.

BIDEN FACES NYC PROTESTERS CHANTING 'DROP OUT JOE!'

In an interview Friday posted on Facebook, Univision journalist Jorge Ramos took issue with a claim that Biden made in September in a debate in Houston that the Obama administration never put migrant children in cages -- in contrast to the Trump administration.

"What Latinos should look at is comparing this president to the president we have is outrageous," Biden said in September. "We didn't lock people in cages. We didn't separate families. We didn't do all of those things."

“You actually did,” Ramos said Friday, showing him a picture of an 8-year-old boy in McAllen, Texas, in 2014.

“What happened was all the unaccompanied children were coming across the border,” Biden said. “We tried to get them out, we kept them safe, and get them out of the detention center... run by Homeland Security and get them into communities as quickly as we can.”

The “cages” are detention centers in which there were also chain-link enclosures. The practice was carried out by both the Obama and Trump administrations, and Biden is correct that in both instances minors were held, in part, for their own safety. An Associated Press fact check last year noted that migrants were housed in the facilities and separated by both age and sex. Those facilities were built and used by the Obama administration, and the Trump administration used the same facilities.

AS TRUMP ADMINISTRATION CONFRONTS MIGRANT CRISIS, DETENTION CENTERS ARE CLEARING OUT

But left-wing lawmakers and pro-immigration activists have accused both administrations, particularly the Trump administration, of “putting kids in cages."

The Trump administration ramped up the practice, in part because it was faced with a significant increase in family units at the border, and also drew controversy with its “zero-tolerance policy” that saw increased separations of minors from their parents and accompanying adults. Amid intense public criticism, the administration walked back the policy in 2018.

Biden, who has tried to tap into that criticism while running for the presidency, disagreed with Ramos’ assessment and instead claimed there were significant differences between the Democratic approach and the Trump administration’s approach.

"Many people would say they were cages," Ramos said.

“You know you’re not telling the truth here about the comparison of the two things,” Biden replied. “Look how quickly we got them out and got them back to families, look at how … we sought the relatives here, we sought to get them into safe communities. We sought to get them out of the control of Homeland Security to get them safe.”

“But they came unaccompanied, unaccompanied,” he said, before saying he was responsible for $750 million in assistance to Central American countries to make it so people didn’t feel the need to migrate in the first place.

CLICK HERE TO GET THE FOX NEWS APP

The exchange is a sign of the difficulty that candidates who hold a more moderate position on illegal immigration and other matters related to immigration could face. On Friday, Sen. Amy Klobuchar, D-Minn., backed away from a 2007 vote she made in which she voted to make English the national language of the U.S.

“I think that when you look at a state like this state, and a country like ours that is so diverse, you don't want to have that provision in law because then it would be very difficult to have, say, government documents and other things translated into other languages,” she said Friday in Nevada. “So that is not a position I take. I did vote that way, but way back then, along with many other people.”

The Associated Press contributed to this report.