Several Democratic 2020 presidential candidates strangely went after former President Barack Obamas administration on many issues, including immigration, during this week’s second-round debates.

On the second night of debates in Detroit on Wednesday, former Vice President Joe Biden faced criticism from other contenders like former Housing Secretary Julian Castro about the Obama administration’s record-high deportation levels. Castro has repeatedly said that as president, he would seek to decriminalize illegal immigration and make it a civil violation rather than a felony. Other candidates seemed to attack Obama and his administration more than President Donald Trump. 

“One of us has learned the lessons of the past and one of us hasn’t,” Castro told Biden in reference to immigration policy in one of the second debate’s standout moments.

The record three million deportations of illegal immigrants under Obama drew severe criticism from many Democrats, including those on stage at this week’s debates, as well as its failed efforts to protect “Dreamers,” migrants who came to the United States as children.

SLIDESHOW: TOP DEMOCRATS RUNNING FOR PRESIDENT IN 2020

“You can’t have it both ways. You invoke President Obama more than anybody in this campaign,” Sen. Cory Booker (D-New Jersey) told Biden after the former vice president began explaining what he would have done differently regarding immigration while working in the White House. “You can’t do it when it’s convenient and dodge it when it’s not.”

Sen. Kamala Harris (D-California) aimed her criticism about Obama’s administration regarding the Affordable Care Act, saying that in the two years under Trump, Obamacare “is not working.”

“What he did and what he accomplished in getting the Affordable Care Act to actually come into being was extraordinary,” said Harris. “But in his own words he has said it was a starter house. He has said Medicare for All is a good idea. So when I talk about my Medicare for All plan it is about building on the success of what President Obama achieved.”

MSNBC host Joe Scarborough called 2020 Democratic candidates’ repeated criticisms of Obama’s administration “politically stupid and crazy” in a tweet during Wednesday night’s debate.