President Trump on Tuesday threatened to shut down the federal government if Congress doesn't present him with a spending bill for the next fiscal year that includes funding for a wall on the southern border.

"The obstructionist Democrats would like us not to do it, but believe me, if we have to close down our government, we're building that wall," Trump said at a rally in Phoenix.

Trump reiterated his message that he was elected to help boost national security and keep illegal immigrants out of the country, many of whom he said are dangerous. He noted that he's met with several families who have lost loved ones due to violence by illegal immigrants.

"I promised these families the deaths of their loved ones will not have been in vain," he said.

As he has since he started running for office last year, Trump said the border wall was going to happen, and warned Democrats that they were harming national security by opposing it.

"We are building a wall on the southern border, which is absolutely necessary," he said.

"Let me be very clear to Democrats in Congress who oppose a border wall and stand in the way of border security," he added. "You are putting all of Americans' safety at risk."

The House has passed legislation that would provide $1.6 billion in funding to begin work on the wall Trump has promised for more than a year now, but it's not clear that language will survive House-Senate negotiations. Trump's threat Tuesday night could prompt Republicans to push for its inclusion, but at the cost of losing votes from Democrats and possibly some Republicans.