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

WASHINGTON — President Donald Trump sat in the Oval Office on Wednesday, listening to his Treasury Secretary argue against a Democratic proposal to raise the government’s debt limit for just three months.

Steven Mnuchin, seated on a couch to the president’s right, had pushed this point before: A longer-term extension of 18 months would extend the deadline past the midterms — which would take partisan politics out of the debate, in his view.

But Senate Minority Leader Chuck Schumer, D-N.Y., disagreed: He wanted something much shorter.

The president, in deal-making mode, had heard enough.

As Mnuchin made his case, Trump cut in: He would side with Schumer, House Minority Leader Nancy Pelosi and the Democrats to make a 90-day deal to lift the debt ceiling.

Five sources who received accounts of the exchange confirmed it to NBC News, with one person describing Mnuchin as seeming initially "wounded" and "surprised" by the president’s action.

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

Still, Mnuchin traveled to North Dakota with the president later in the day, and on the way back told reporters on Air Force One: "I could not be happier that we had bipartisan support today" to extend the debt ceiling. Another person inside the administration echoed that Mnuchin was ultimately "very supportive” of his boss' decision to make a spending deal with Democrats.

Back in the Oval Office hours earlier, Senate Majority Leader Mitch McConnell, R-Ky., jumped in: If there were to be a short-term deal on the debt ceiling, then he wanted to add a provision to keep the government open for the next three months, too.

House Speaker Paul Ryan, R-Wis., blindsided and growing angry, sat across from McConnell. Both listened as the president summoned his daughter: He wanted Ivanka Trump to share details about the child care tax credit that had become one of her signature issues on the campaign trail. One top congressional aide said Ivanka's entrance derailed the conversation, although a White House source described it as a "quick and productive" discussion.

As the meeting wound down, even the president’s own advisers were stunned by the new deal.

"We did not know this was going to happen," one administration source said. "I don’t think anyone did."

It’s a sequence of events that handed enormous leverage to Democrats as lawmakers brace for a serious showdown in December.

It’s also being perceived by some close to Trump as a deliberate swipe at GOP leadership from a president still festering over the failure of the GOP-led health care reform effort. But White House aides insisted Trump is simply pushing to accelerate action on critical issues like the hurricane relief funding attached to the short-term debt limit bill.

"Donald Trump is a consummate dealmaker,” said Kellyanne Conway, in an interview with NBC News' Kristen Welker. "What that means for people in Washington who have been living and working in this swamp for too long is that they’re just not used to the Trump pace of getting things done."

Top legislative affairs aide Marc Short, talking with reporters on Air Force One, framed the deal as a way to "clear the decks" for tax reform more quickly.

Shortly after the Oval Office meeting wrapped up, Trump departed the White House for North Dakota. Republican leaders returned to Capitol Hill tight lipped — Majority Leader Kevin McCarthy, R-Calif., dodging cameras, face drawn. Just over an hour earlier, Ryan had accused Democrats of playing politics with America's credit. "Disgraceful," he had said.

But up on Air Force One after the meeting, Trump was triumphant. He didn't mention Ryan or McConnell.

“We had a very good meeting with Nancy Pelosi and Chuck Schumer," the Republican president said.