WASHINGTON — President Trump abruptly blew up an infrastructure meeting with Democratic leaders at the White House on Wednesday and declared that bipartisan cooperation was impossible while House committees are investigating him, underscoring the increasing combustibility between two warring branches of government.

Trump refused to even sit down when he walked into the scheduled Cabinet Room meeting with House Speaker Nancy Pelosi (D-San Francisco) and Senate Minority Leader Charles E. Schumer (D-N.Y.). He then headed to a hastily called news conference in the Rose Garden.

Trump told reporters there that he gave the surprised Democratic leaders an ultimatum, warning that they needed to choose between pursuing infrastructure or their investigations of his finances, businesses and administration.

“You probably can’t go down two tracks,” he said. “You can go down the investigation track, or you can go down the investment track.

“I walked into the room and I told Sen. Schumer and Speaker Pelosi, ‘I want to do infrastructure. I want to do it more than you want to do it,’” Trump said.

“‘But you know what? You can’t do it under these circumstances. So get these phony investigations over with.’”

The acrimony erupted as the president was dealt another setback in court. For the second time in two days, a federal judge rejected Trump’s refusal to honor congressional subpoenas and ordered him to turn over financial records to Democratic-led committees.

On Wednesday, a federal judge in New York rejected Trump’s efforts to block a subpoena aimed at forcing Deutsche Bank and Capital One to hand over his financial records to the House Financial Services and Intelligence committees. Trump’s attorneys are expected to appeal the decision.

On Tuesday, a federal judge in Washington ruled that Trump cannot block a subpoena from the House Oversight Committee for financial information from his accounting firm, Mazars USA. Trump’s lawyers already have appealed.

And lawmakers in New York passed legislation Wednesday that will allow the state’s Department of Taxation and Finance to release the state tax returns of public officeholders at the federal, state and local levels that are requested by the leaders of congressional tax-writing committees. Gov. Andrew Cuomo, a Democrat, is expected to sign the bill into law.

It wasn’t clear if Trump’s threat not to cooperate with Democrats was mere bluster or signaled the death knell to any infrastructure plan or other compromises on key legislative issues before the 2020 election.

In January, Trump stormed out of a meeting with Pelosi and Schumer during a partial government shutdown over funding for his border wall. The 35-day shutdown ended when the president backed down.

Trump laid down a similar threat of noncooperation during his State of the Union address in February, saying: “If there is going to be peace and legislation, there cannot be war and investigation. It just doesn’t work that way.”

Trump made clear Wednesday he was irked by Pelosi’s charges, made at an earlier news conference, that the president’s stonewalling of up to 20 House investigations amounts to a “cover-up,” comments that added fuel to some Democrats’ demands for impeachment proceedings.

“I don’t do cover-ups,” Trump said, blaming Democrats for what he called unfair harassment. “These people are out to get us.”

After returning to the Capitol, Democrats called their own news conference to say they were stunned that Trump had stormed out of the meeting before anyone else could speak.

“To watch what happened in the White House would make your jaw drop,” Schumer said. “We are interested in doing infrastructure. It’s clear the president isn’t. He is looking for every excuse.”

Schumer said the premade sign affixed to the president’s lectern in the Rose Garden — “No Collusion, No Obstruction,” it read — showed that Trump’s walkout was long planned. He suggested the president had staged the incident because the White House had failed to find a way to fund an infrastructure bill.

Schumer said he’d brought a 35-page infrastructure proposal to the White House, attempting to contrast Democrats’ good-faith approach to talks with the president’s reluctance.

“Now that he was forced to come up with a way to pay for it, he ran away,” he said.

Pelosi, who said Democrats don’t believe the House investigations jeopardized the infrastructure talks, opted not to speculate as to what motivated Trump’s behavior.

The president, she said, “couldn’t match the greatness of the challenge that we have. … He just took a pass, and it makes me wonder why he did that,” she said. “In any event, I pray for the president of the United States.”

On Tuesday night, Trump sent Pelosi and Schumer a letter informing them that he wants Congress to ratify the revamped free trade agreement with Canada and Mexico before they take up infrastructure. In that letter, he asked Democrats to clarify their priorities with specific funding requests.

More House Democrats called this week for impeachment proceedings as the White House continued to defy subpoenas, refusing to hand over documents or allow current or former administration officials to testify in the aftermath of the special counsel report from Robert S. Mueller III, who laid out 10 examples of Trump attempting to interfere with the investigation.

“We’ve all been struggling with this on a personal basis about what’s the right thing to do given our obligation based on the oath we swore to the Constitution,” said Rep. Katie Hill (D-Agua Dulce), who said calls to her office about impeachment have risen dramatically, with 3 to 1 in support.

House Democrats have vowed to operate on two tracks: conducting appropriate oversight of the executive branch while they try to work with Trump on legislation. That focus is important for moderate Democrats who won in swing districts and want to cite legislative accomplishments in their 2020 campaigns.

But Trump sought to knock that compartmentalized approach off the table Wednesday, insisting that Democrats must choose one path or the other. Democrats, buoyed by the latest court decisions, made clear they don’t agree.

Shortly before Wednesday’s White House meeting, Pelosi huddled with House Democrats, where she asked for patience from those who favor impeachment, given the president’s refusal to cooperate with investigations.

“That was really the message: Be a little bit patient,” said Rep. Gerald E. Connolly (D-Va.), a member of the House Oversight Committee. “Things are kind of breaking our way, and more is about to happen. Let’s not rush to something that we can’t take back.”

Pelosi sought to placate the pro-impeachment members by emphasizing that the White House is engaging in a “cover-up” when she spoke to reporters afterward.

“We do believe it’s important to follow the facts. We believe that no one is above the law, including the president of the United States, and we believe that the president of the United States is engaged in a cover-up — in a cover-up,” she said.

Repairing the country’s crumbling bridges, airports, roads and other infrastructure was one of the few issues where Democrats and Republicans appeared to have common interests.

Last month, Trump welcomed Pelosi and Schumer to the White House and vowed to pursue a $2-trillion plan, although he didn’t say how he would pay for it. The Democratic leaders emerged from that meeting pleasantly surprised by Trump’s eagerness to pass a massive infrastructure bill, and both sides agreed to meet again in three weeks.

The onus, Democrats said then, was on the administration to come up with a funding plan. But Trump quickly faced blowback from congressional Republicans, who opposed raising the gas tax, the traditional funding source for such improvements.

The White House, according to two sources involved in ongoing discussions, has no plan to generate revenue for infrastructure aside from deep budget cuts to existing nonmilitary programs, something Democrats are sure to oppose.

“It was night and day between this time and last time,” Rep. Peter A. DeFazio (D-Ore.), chairman of the House Transportation and Infrastructure Committee.

Pelosi said in a letter to Democratic colleagues that the House would still try to pass a “big, bold and bipartisan” package, but DeFazio made clear that was unlikely without Trump. “We need him, otherwise there’s no prospects for a larger, comprehensive bill with robust funding,” he said.

DeFazio said that acting White House Chief of Staff Mick Mulvaney and Senate Majority Leader Mitch McConnell (R-Ky.) were both “100% dead set against doing infrastructure,” he said. “Trump has promised it and they don’t care.”