Democratic presidential candidates' embrace of proposals like decriminalizing border crossings is "tantamount to declaring publicly that we have open borders," said Jeh Johnson, who ran the Department of Homeland Security under President Barack Obama.

Former Housing and Urban Development Secretary Julián Castro last week challenged his fellow Democrats on the debate stage to support repealing Section 1325 of the US Code, which makes it a crime for immigrants to improperly enter the US.

Many of the candidates onstage agreed with Castro.

Visit Business Insider's homepage for more stories.

Julián Castro, a former secretary of housing and urban development who's running for the Democratic presidential nomination, challenged fellow candidates at the first debates last week to support decriminalizing border crossings, a stance that a top Homeland Security official in the Obama administration called practically an embrace of "open borders."

Jeh Johnson, the secretary of homeland security during President Barack Obama's second term, told The Washington Post on Tuesday that some 2020 Democrats were pushing border-security reforms that might be ineffective and outside the immigration policies that most Americans want.

Read more: Julián Castro is running for president in 2020. Here's everything we know about the candidate and how he stacks up against the competition.

"That is tantamount to declaring publicly that we have open borders," Johnson said of the push to decriminalize border crossings. "That is unworkable, unwise and does not have the support of a majority of American people or the Congress, and if we had such a policy, instead of 100,000 apprehensions a month, it will be multiples of that."

At the Democratic debate in Miami last Wednesday, Castro demanded his fellow candidates embrace the repeal of Section 1325 of the US Code, which makes it a crime for immigrants to improperly cross the border.

Read more: Half of Democratic primary voters support decriminalizing illegal entry into the US

When former Rep. Beto O'Rourke did not embrace Castro's challenge, the Texas rivals got into a spat that created one of the more viral moments of the evening.

"I think that you should do your homework on this issue," Castro told O'Rourke. "If you did your homework on this issue, you would know we should repeal this section."

Read more: Congress sends massive border-funding bill to Trump's desk after Nancy Pelosi caves under pressure

Sen. Amy Klobuchar of Minnesota also tried to reel in the conversation by talking about not decriminalizing the crossings of smugglers and human traffickers.

"But I do think you want to make sure that you have provisions in place that allow you to go after traffickers and allow you to go after people who are violating the law," she said.