President Trump plunged into a new year of work and partisan warfare Wednesday after 12 lonely shutdown days in the White House, pressuring Democrats for a deal on border security and reasserting his superiority on everything from the military to lawmakers who cross him.

During a more than 90-minute public Cabinet meeting, Mr. Trump delivered at times a stream-of-consciousness monologue on the state of world affairs as if he’d been bottled up without a live audience during the holiday-season isolation. He predicted the partial government shutdown could last “a long time” if Democrats who are taking control of the House on Thursday don’t cooperate with him.

“We have a long way to go and we want to solve the problems, not just sit back and enjoy the presidency,” Mr. Trump said.

SEE ALSO: Trump: I ‘essentially’ fired Defense Secretary Mattis; ‘What’s he done for me?’

He conducted the entire Cabinet meeting seated in front of a movie-like poster of himself in a “Game of Thrones” genre on the mahogany table. It proclaimed “Sanctions are Coming.”

The president invited congressional leaders of both parties to the White House situation room Wednesday afternoon for a “border-security briefing,” followed by face-to-face budget negotiations that had been absent since Democrats left town on Dec. 22. Democratic leaders Rep. Nancy Pelosi and Sen. Charles E. Schumer were still vowing not to give the president any of the $5.6 billion he seeks for barriers on the southern border.

Emerging from the meeting in late afternoon, Mr. Schumer said he asked the president to support Democrats’ bill to reopen government without resolving the question of border security.

SEE ALSO: Trump slams Mitt Romney as another ‘Flake’ after lawmaker’s criticism

“I said to him, ‘give me one good reason why you should continue your shutdown,’” Mr. Schumer told reporters. “He could not give a good answer.”

Mr. Trump seemed re-energized at the prospect of negotiations, after a holiday stretch in Washington that he described as secluded.

“I was here on Christmas Eve,” he said. “I was all by myself in the White House. It’s a big, big house, except for all the guys out on the lawn with machine guns. I was waving to them. They don’t, like, wave. They don’t even smile. I was all alone with the machine-gunners. I was hoping that maybe somebody would come back and negotiate. But they didn’t do that.”

Now that Democrats are back in town, he said the shutdown will go on “as long as it takes.”

“I think the people of this country think I’m right,” he said of the border wall dispute. “I could have had a lot easier presidency by doing nothing. But I’m here.”

While demanding that Congress pay for the wall, Mr. Trump also insisted again Wednesday that Mexico will end up paying for the wall through the revised terms of the U.S. trade agreement with Mexico and Canada. Nothing in the agreement, which has yet to be approved by Congress, requires Mexico to pay for a wall.

The eve of divided government for the first time in Mr. Trump’s presidency didn’t have any outward impact on his agenda that won him the White House. For example, the president repeatedly cited the need to tighten the southern border as a national-security issue, and reiterated his desire to end costly long-term military deployments in places such as Afghanistan and Syria.

“I gave our generals all the money they wanted,” Mr. Trump said. “They didn’t do such a great job in Afghanistan. They’ve been fighting in Afghanistan for 19 years. I didn’t put us there. We spend in Afghanistan more in one month than what we’re talking about for the wall.”

Of Syria, he said, “I don’t want to be in Syria forever. It’s sand, and it’s death.”

Defense Secretary James N. Mattis resigned last month over Mr. Trump’s insistence on bringing troops home. The president said Wednesday that he had “essentially” fired the legendary retired Marine Corps general.

“What’s he done for me? How had he done in Afghanistan? Not too good,” Mr. Trump said of Mr. Mattis, who resigned last month.

The president said Mr. Mattis was “so thrilled” when he met the defense chief’s request to beef up the Pentagon’s budget to more than $700 billion per year. But he said the defense secretary didn’t reciprocate by giving him the policy results he was seeking.

“I’m not happy with what he’s done in Afghanistan,” the president said. “I want results. I want to spend money on our military without depleting it every day.”

Mr. Mattis and the president disagreed over Mr. Trump’s desire to withdraw troops from Syria and Afghanistan. The defense secretary planned to leave his post at the end of February, but Mr. Trump pushed up his departure date to Dec. 31.

“As you know, President Obama fired him, and essentially so did I,” Mr. Trump said.

Reporters asked for Mr. Trump’s reaction to fresh criticism from Republican Sen.-elect Mitt Romney of Utah, who wrote in an op-ed that the president “has not risen to the mantle of the office.” Mr. Trump said he hoped Mr. Romney would be a “team player,” and reminded reporters what happened to other recently retired Republican senators who criticized him.

“Jeff Flake is now selling real estate or whatever he’s doing,” he said of the Arizona Republican. “Bob Corker [of Tennessee] was going to be a senator for another 20 years. Then he hit me. It didn’t work out too well.”

The president dismissed the precipitous loss of nearly $3 trillion in U.S. stock value in December as “a little glitch,” and predicted the markets would rebound.

It was the first Cabinet meeting since the mid-term elections in November, and the personnel around the table partly reflected the year-end staff shakeup since the GOP lost the House.

Seven of the 21 Cabinet members were serving in an acting capacity, having yet to face Senate confirmation: Acting Defense Secretary Patrick Shanahan, acting Attorney General Matthew Whitaker, acting Interior Secretary David Bernhardt, acting EPA Administrator Andrew Wheeler, acting U.N. Ambassador Jonathan Cohen, acting Office of Management and Budget Director Russell Vought, and acting White House Chief of Staff Mick Mulvaney, the former OMB director whose new post does not require Senate confirmation.

As he allowed the media to remain in the Cabinet meeting for more nearly one hour and 45 minutes, Mr. Trump used the opportunity to recite many of his big moments from his first two years, including pulling the U.S. out of the Iran nuclear deal and pushing European allies to pay more for the NATO alliance. He spoke of cutting off aid to countries such as Pakistan.

“That’s why I got elected — issues like that,” Mr. Trump said. “If I was popular in Europe, I wouldn’t be doing my job. I shouldn’t be popular in Europe. I don’t care about Europe. I’m not elected by Europeans, I’m elected by Americans, and by American taxpayers, frankly.”

Turning again to Afghanistan, the president focused on the cost of the military deployment of 8,000 troops, rather than the country’s role as a base for the 9/11 terrorist attacks against the U.S. He said regional neighbors should be deployed in Afghanistan to help stop the growth of extremists there.

“Why isn’t Russia there? Why isn’t India there? Why isn’t Pakistan there?” he asked. “Why are we there, when we’re 6,000 miles away?”

He said Russia “was right to be there” in the 1980s fighting the Taliban.

“The problem was it was a tough fight,” he said, neglecting to mention that the U.S. provided covert aid to insurgents fighting what was then the Soviet Union.