Donald Trump says he will close down the US government if necessary to build his wall along the Mexico border.
The president told supporters at a "Make America Great Again" rally in Phoenix, Arizona, that the opposition Democrats were being "obstructionist".
During the 80-minute speech, he also took aim at the media, blaming them for giving far right groups "a platform".
But he selectively quoted his initial response to violence at a far-right rally that left one woman dead.
He omitted the much-criticised claim that "many sides" had to shoulder the blamefor violence in Charlottesville, Virginia.
What did he say about the wall?
President Trump wants Congress to finance his controversial plan to build a "big, beautiful" wall along the United States' border with Mexico to keep out illegal immigrants.
But Republicans will need the support of Democrats to secure funding for the wall in a government spending bill, which they are unlikely to get.
In his speech, Mr Trump said the Democrats were "putting all of America's safety at risk" by opposing the wall. He said immigration officers who worked in the area said it was "vital" to stem the flow of illegal immigrants.
"Now the obstructionist Democrats would like us not to do it, but believe me if we have to close down our government, we are building that wall," Mr Trump said, adding that "the American people voted for immigration control".
What did he say about Charlottesville?President Trump attacked the media in the campaign-style speech, saying reporters had misrepresented his "perfect" words in the wake of the violence in Charlottesville, where Heather Heyer was killed after a car ploughed into a crowd of people protesting against far-right demonstrators including neo-Nazis.
He accused "truly dishonest people in the media and the fake media" of "trying to take away our history and heritage" because, he said, they "don't like our country".
for not explicitly condemning the far-right.
"This is what I said on Saturday: 'We're closely following the terrible events unfolding in Charlottesville, Virginia,' - this is me speaking. 'We condemn in the strongest possible terms this egregious display of hatred, bigotry and violence.' That's me speaking on Saturday, right after the event," he said.
But his full quote was: "We condemn in the strongest possible terms this egregious display of hatred, bigotry and violence on many sides, on many sides."
Separately, the UN Committee on the Elimination of Racial Discrimination has criticised the US for what it said was a "failure at the highest political level" to reject "racist violent events".
Referring to Charlottesville, the committee said it was issuing a rare "early warning", which has been used in recent years in countries including Burundi, Iraq, Nigeria and the Ivory Coast.
Reacting to the speech, the former National Intelligence director James Clapper told CNN that he was questioning Donald Trump's "fitness" for office.
"I also am beginning to wonder about his motivation for it," he said, adding he found the rally "downright scary and disturbing".
Ruben Gallego, a Democratic Party congressman in Arizona, said it was was the worst-ever speech by a US president. "It was all about him, it was not about the country," he told the BBC.
But Trump supporters were pleased.
"President Trump did an amazing job tonight. His message is uniting our great nation!", tweeted Ryan Fournier, the head of Students for Trump.
White Nationalist Richard Spencer tweeted: "Trump has never denounced the Alt-Right. Nor will he."