Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

WASHINGTON — President Donald Trump slammed "ridiculous partisan investigations" in his State of the Union address to Congress on Tuesday night after calling for greater political unity.

"An economic miracle is taking place in the United States — and the only thing that can stop it are foolish wars, politics or ridiculous partisan investigations," Trump said as Republicans applauded and Democrats sat stone-faced during his prime-time, nationally televised address to a joint session of Congress.

"If there is going to be peace and legislation, there cannot be war and investigation," the president continued, presumably referring to special counsel Robert Mueller's Russia investigation. "It just doesn't work that way!"

Trump also announced he would meet for a second time with North Korean leader Kim Jong Un on Feb. 27 and 28 in Vietnam to discuss the rogue nation's nuclear program.

"As part of a bold new diplomacy, we continue our historic push for peace on the Korean Peninsula," Trump said. "Our hostages have come home, nuclear testing has stopped, and there has not been a missile launch in 15 months."

Trump has often hailed his first meeting with Kim last June as a major breakthrough, but experts say the North Korean regime has continued to develop weapons in secret, since it sees them as crucial to its survival.

"If I had not been elected President of the United States, we would right now, in my opinion, be in a major war with North Korea," Trump declared, eliciting some gasps from lawmakers.

Clocking in at one hour and 22 minutes, it was the third-longest State of the Union address in history — two minutes longer than his address last year, while a bit shorter than Bill Clinton's speeches in 1995 and 2000.

With the longest government shutdown in U.S. history over and another potential one around the corner, Trump will need to try to bring both parties in Congress together before funding runs out again on Feb. 15.

"The agenda I will lay out this evening is not a Republican agenda or a Democrat agenda. It is the agenda of the American People," he said. "We can bridge old divisions, heal old wounds, build new coalitions, forge new solutions, and unlock the extraordinary promise of America's future."

But Trump also used the speech to continue his push the divisive issue that was at the center of the shutdown impasse — a border wall with Mexico — insisting, "I will get it built."

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

"Tolerance for illegal immigration is not compassionate — it is cruel,” the president said, noting that he is ordering additional 3,750 troops to the southern border in anticipation of more migrants and refugees seeking to gain entry into the U.S.

"No issue better illustrates the divide between America's working class and America's political class than illegal immigration," the president continued. "Wealthy politicians and donors push for open borders while living their lives behind walls and gates and guards."

Trump insisted he favors expanding legal immigration, deviating from his prepared remarks to say, "I want people coming into this country (legally) in the largest numbers ever." But his administration has actually pushed hard for substantial cuts to legal immigration in addition to crackdowns on undocumented immigrants.

He did not declare a national emergency to give him the power to build a border wall without congressional approval, although he has threatened to do so.

Democrats sat uncomfortably during the immigration portion of the speech, with many shaking their heads and audibly objecting — until House Speaker Nancy Pelosi raised a hand to quite them.

In the audience were some of the top contenders vying for a chance to face off against Trump in 2020, and their campaigns quickly turned the candidates' eyerolling and headshaking into fundraising and social media fodder.

He seemed to target some of them by saying he was "alarmed" by new calls to adopt socialism. "Tonight, we renew our resolve that America will never be a socialist country," he said.

But Trump earned some rare approval from Democrats when he celebrated the record number of women elected to Congress in last year's midterm elections.

"All Americans can be proud that we have more women in the workforce than ever before — and exactly one century after Congress passed the Constitutional amendment giving women the right to vote, we also have more women serving in Congress than ever before," Trump said.

Female lawmakers cheer during President Donald Trump's State of the Union address. Chip Somodevilla / Getty Images

Democratic women, wearing white to honor the suffragette movement, stood and cheered, including some of Trump's staunchest foes like Rep. Alexandria Ocasio-Cortez, D-N.Y. A chant of "U-S-A! U-S-A!" broke out.

It was Trump's first time speaking to Congress since Democrats won back the House in November and reminders of Pelosi's new power will be impossible to miss as she sat just over his left shoulder wearing a large gold brooch that represented the ceremonial Mace of the House of Representatives.

Even the timing of the speech was determined by the new reality in Washington, after Pelosi successfully pressured Trump to delay the address, originally scheduled for last month, until after the government shutdown ended.