“The numbers that you gave are wrong,” he told one reporter. “It’s a fake question.”

On point after point, the president insisted that he would be proved correct. “People said, ‘Trump is crazy,’” he said at one point, discussing his outreach to Mr. Kim. “And you know what it ended up being? A very good relationship.”

[President Trump declared a national emergency. What happens now?]

Mr. Trump acknowledged that his declaration of a national emergency would be litigated in the courts and even predicted a rough road for his side. “Look, I expect to be sued,” he said, launching into a mocking riff about how he anticipated lower court rulings against him. “And we’ll win in the Supreme Court,” he predicted.

Indeed, Public Citizen, an advocacy group, filed suit by the end of the day on behalf of three Texas landowners whose property might be taken for a barrier. California and New York likewise announced that they will sue over what Gov. Gavin Newsom of California called the president’s “vanity project,” and a roster of other groups lined up to do the same. “Fortunately, Donald Trump is not the last word,” said Mr. Newsom, a Democrat. “The courts will be the last word.”

Among those predicting a flurry of judicial decisions against Mr. Trump was George T. Conway III, a conservative lawyer and the husband of Kellyanne Conway, the president’s counselor. “If he knows he is going to lose,” Mr. Conway, a vocal critic of Mr. Trump, wrote on Twitter, “then he knows he is violating the Constitution and laws he has sworn to uphold.”

The House Judiciary Committee announced Friday that it would investigate the president’s emergency claim, while House Democrats plan to introduce legislation to block it. That measure could pass both houses of Congress if it wins the votes of the half-dozen Republican senators who have criticized the declaration, forcing Mr. Trump to issue the first veto of his presidency.

The emergency declaration, according to White House officials, enables the president to divert $3.6 billion from military construction projects to the wall. Mr. Trump will also use more traditional presidential discretion to tap $2.5 billion from counternarcotics programs and $600 million from a Treasury Department asset forfeiture fund.

Combined with $1.375 billion authorized for fencing in the spending package passed on Thursday night, Mr. Trump would have about $8 billion in all for barriers, significantly more than the $5.7 billion he unsuccessfully demanded from Congress.