US presidential candidate Joe Biden has been defending illegal immigrants on the 2020 campaign trail but was singing from a different hymn sheet in the run-up to, and during, his last bid for the commander in chief.

Biden last week referred to the border debate as “a crisis created by Trump” but it wasn’t so long ago that the former Vice President sounded a lot like the Republican president.

Read More: Joe Biden describes illegal immigrants as “the best of every nation”

In fact, Biden once spoke about jailing employers who hired "illegals," said sanctuary cities shouldn't be allowed violate federal law and argued a fence was needed stop "tons" of drugs coming into the US from "corrupt Mexico."

Democratic candidate U.S. Senator Joe Biden (D-DE) speaks during the Des Moines Register Democratic Presidential Debate at the Iowa Public Television studios December 13, 2007 in Johnston, Iowa. Image: Getty

Democratic candidate U.S. Senator Joe Biden (D-DE) speaks during the Des Moines Register Democratic Presidential Debate at the Iowa Public Television studios December 13, 2007 in Johnston, Iowa. Image: Getty

Before officially stepping into the 2008 presidential race, then-Senator Biden touted his support for the Secure Fence Act - a bill that authorized 700 miles of double-layered fence on the border through more than a billion dollars in appropriations.

The bill was also supported by then-Senators Barack Obama and Hillary Clinton as well as current Senate Minority Leader Chuck Schumer.

Read More: Joe Biden’s identity politics won't beat Trump, or Bernie

"Folks, I voted for a fence, I voted, unlike most Democrats, and some of you won't like it, I voted for 700 miles of fence," he said to a South Carolina rotary club in November 2006.

"But, let me tell you, we can build a fence 40 stories high, unless you change the dynamic in Mexico and, and you will not like this, and punish American employers who knowingly violate the law when, in fact, they hire illegals. Unless you do those two things, all the rest is window dressing."

"Now, I know I'm not supposed to say it that bluntly, but they're the facts, they're the facts. And so everything else we do is in between here. Everything else we do is at the margins. And the reason why I add that parenthetically, why I believe the fence is needed does not have anything to do with immigration as much as drugs," Biden continued.

Read More: Joe Biden is a touchy-feely, old-style Irish politician - get used to him

“And let me tell you something, folks, people are driving across that border with tons, tons, hear me, tons of everything from byproducts for methamphetamine to cocaine to heroin and it's all coming up through corrupt Mexico."

Speaking at a September 2007 debate at Dartmouth College in New Hampshire, Biden said he would not allow sanctuary cities to ignore federal law.

Real estate mogul Donald Trump announces his bid for the presidency in the 2016 presidential race during an event at the Trump Tower on the Fifth Avenue in New York City on June 16, 2015. Image: Getty

Real estate mogul Donald Trump announces his bid for the presidency in the 2016 presidential race during an event at the Trump Tower on the Fifth Avenue in New York City on June 16, 2015. Image: Getty

"Yes or no, would you allow those cities to ignore the federal law?" Biden was asked. "No," he responded.

At another 2007 event, Biden called for sending employers of undocumented immigrants to prison.

"We've got to get tougher with employers. If they, in fact, the person we should send to jail is not the illegals, you should send to jail the employer," Biden said.

"If you knowingly hire, knowingly hire an illegal alien, then you should be held accountable. Because let me tell you, the next person I hear tell me that my labor guys aren't willing to work hard, that's why you have illegals putting up sheetrock, then I want to tell you, you don't know my guys."

Read more: Is Joe Biden's family scandal likely to end his bid for the White House?

During the 2008 campaign Biden also opposed granting driver's licenses to undocumented immigrants and his immigration plan also called for increasing funding for border patrol.

What do make of Biden’s past position on illegal immigration? Let us know in the comments below