Joe Biden got a harsh reality check Wednesday during the second night of Democratic primary debates in Detroit as he discovered that repeatedly evoking the name of former President Barack Obama—at least with respect to immigration—is not necessarily helpful.

Biden's perceived unwillingness to learn from the past is increasingly a line of attack for his fellow Democrats, who seem to smell blood, especially after Sen. Kamal Harris (D-Calif.) broke the seal on criticizing Obama-era immigration policies in the first primary debate.

The former vice president, who is running to face President Donald Trump in the 2020 general election, has found success in touting his connection to Obama's administration in the past.

But on Wednesday Biden could no longer hide behind the popular ex-president, as Biden found himself under attack from, among others, former Secretary of Housing and Urban Development Julián Castro, with whom Biden served under Obama.

After a back and forth that began with protesters in the audience calling out "three million deportations," a reference to the record deportations under Obama, Biden replied to Castro's critiques with an attack on what Biden implied was Castro's unwillingness while in the administration to take a stand.

"3 million deportations!": Protester yells about number of deportations under Obama as Biden takes immigration question #DemDebate2 https://t.co/czltk6le6Z pic.twitter.com/HvPFspUlQl — The Hill (@thehill) August 1, 2019

"We sat together in many cabinet meetings,”" said Biden "I never heard him talk about any of this when he was secretary."

As writer Marisa Kabas remarked, this was "a big mistake" because Castro was waiting for him and pounced.

SCROLL TO CONTINUE WITH CONTENT Never Miss a Beat. Get our best delivered to your inbox.







"One of us has learned the lessons of the past," said Castro, "and one of us hasn't."

Castro responds to Biden on immigration: "One of us has learned the lessons of the past and one of us hasn't. ... What we need are politicians that actually have some guts on this issue" #DemDebate https://t.co/YM1tQQyymq pic.twitter.com/Z6j8JDw7ZY — CNN Politics (@CNNPolitics) August 1, 2019

Biden tried to evade the controversy by claiming he had helped to advise Obama on immigration, but demurred when asked specifics, claiming that it was private and part of his duty as vice president. That opened the door to a ringing attack from Sen. Cory Booker (D-N.J.).

"Mr. Vice President, you can't have it both ways," said Booker. "You invoke President Obama more than anybody in this campaign. You can't do it when it’s convenient and then dodge it when it's not."

Booker lands a body blow on Biden, points out how his invocations of Obama are conveniently selective pic.twitter.com/YbetXGdPn4 — Aaron Rupar (@atrupar) August 1, 2019

Boston-based activist Jonathan Cohn applauded Booker's comments.

"Good on Booker for calling out how Biden wraps himself in Obama's record when he wants to take credit for it but won't own any of the bad parts," said Cohn.