WASHINGTON (Reuters) - President Donald Trump forced out his attorney general on Wednesday and threatened to fight back if Democrats use their new majority in the U.S. House of Representatives to launch investigations into his administration and finances.

Trump came out swinging a day after his Republicans lost control of the House, and followed through on repeated threats to remove Attorney General Jeff Sessions.

Sessions, a 71-year-old former U.S. senator from Alabama, was an early and loyal supporter of Trump but drew his fury when he recused himself from an investigation into Russian meddling in the 2016 White House campaign.

His departure was the first in what could be a string of high-profile exits as Trump reshapes his team to gird for his own 2020 re-election effort. The Republican president named Sessions’ chief of staff, Matthew Whitaker, as acting attorney general and said he would nominate someone for the job soon.

Trump’s move prompted sharp criticism from Democrats, who said he was seeking to undermine the Russia probe.

Nancy Pelosi, the House Democratic leader who could be the next speaker, said in a statement posted to Twitter that Sessions’ ouster was a “blatant attempt” to undermine the Russia probe. She urged Whitaker, who now oversees Special Counsel Robert Mueller and has argued Mueller’s investigation has gone too far, to recuse himself from any involvement.

During a combative news conference in which he tangled with reporters, Trump trumpeted his role in Republican gains in Tuesday’s midterm congressional elections, and warned of a “warlike posture” in Washington if Democrats investigated him.

Democrats will now head House committees that can probe the president’s tax returns, which he has refused to turn over since he was a candidate, possible business conflicts of interest and any links between his 2016 campaign and Russia, a matter being investigated by Mueller.

Trump said he could fire Mueller if he wanted but was hesitant to take that step. “I could fire everybody right now, but I don’t want to stop it, because politically I don’t like stopping it,” he said.

Moscow denies meddling. Trump, calling the Mueller probe a witch hunt, has repeatedly said there was no collusion.

Trump was buoyed on Wednesday by victories that added to the Republican majority in the U.S. Senate, telling reporters at the White House that the gains outweighed the Democrats’ takeover of the House. The expanded Senate majority could make it easier for Trump to confirm a new attorney general, who will need a majority of votes in the 100-seat chamber.

Trump added that he was willing to work with Democrats on key priorities but felt any House investigations of his administration would hurt prospects for bipartisanship.

“They can play that game, but we can play it better,” Trump said. “All you’re going to do is end up in back and forth and back and forth, and two years is going to go up and we won’t have done a thing.”

The divided power in Congress combined with Trump’s expansive view of executive power could herald even deeper political polarization and legislative gridlock in Washington.

There may be some room, however, for Trump and Democrats to work together on issues with bipartisan support such as a package to improve infrastructure, protections against prescription drug price increases and the push to rebalance trade with China.

“It really could be a beautiful bipartisan situation,” Trump said.

He said Pelosi had expressed to him in a phone call a desire to work together. With Democrats mulling whether to stick with Pelosi, who was speaker when the party last controlled the House, or go in a new direction, Trump wrote in a tweet earlier on Wednesday that she deserved to be chosen for the position.

Slideshow ( 25 images )

Pelosi, at a Capitol Hill news conference before news of Sessions’ departure, said Democrats would be willing to work with Trump where possible. But she added: “We will have a responsibility to honor our oversight responsibilities and that’s the path we will go down. We again (will) try to unify our country,” she said.

The Democrats fell short of a tidal wave of voter support that would have won them control of both chambers of Congress. But in the 435-member House, the party was headed for a gain of about 30 seats, beyond the 23 they needed to claim their first majority in eight years.

A Senate majority would have allowed Democrats to apply even firmer brakes on Trump’s policy agenda and given them the ability to block any future Supreme Court nominees.

House Democrats could force Trump to scale back his legislative ambitions, possibly dooming his promises to fund a border wall with Mexico and pass a second major tax-cut package. Legislators could also demand more transparency from Trump as he negotiates new trade deals with Japan and the European Union.

Slideshow ( 25 images )

“Today is more than about Democrats and Republicans; it’s about restoring the Constitution’s checks and balances to the Trump administration,” Pelosi told supporters at a victory party on Tuesday night.

Trump also mocked Republican candidates who had refused to back his policies and ultimately lost their races, such as U.S. Representative Barbara Comstock of Virginia.

“They did very poorly. I’m not sure that I should be happy or sad but I feel just fine about it,” he said.

GRIDLOCK?

U.S. stocks jumped on Wednesday as investors, who often favor Washington gridlock because it preserves the status quo and reduces uncertainty, bought back into a market that had its worst month in seven years in October. The Dow Jones Industrial Average ended up 2.13 percent on Wednesday, while the broad-based S&P 500 index rose 2.12 percent. The dollar index, a measure of the greenback against a basket of currencies, was slightly weaker.

A Democratic-controlled House could hamper Trump’s attempts to further his pro-business agenda, fuelling uncertainty about his administration. His corporate tax cuts and the deregulation that have played a large hand in the U.S. stock market’s rally since the 2016 election, however, are likely to remain untouched.

Democrats will use their new majority to reverse what they see as a hands-off approach by Republicans toward Trump’s foreign policy, and push for tougher dealings with Russia, Saudi Arabia and North Korea.

Foreign policy has been an area that Trump has approached in a very personal way, sometimes antagonizing allies such as Canada, while making what critics see as unduly warm overtures to traditional U.S. rivals or foes.

Tom Perez, chairman of the Democratic National Committee, said Democrats could work with Republicans to produce a long-awaited bill to upgrade the nation’s roads, bridges and airports.

“Of course, we want to work in a bipartisan fashion. I think we can get an infrastructure bill,” he said. Trump had hardened his rhetoric in recent weeks on issues that appealed to his conservative core supporters. He threw himself into the campaign, issuing warnings about a caravan of Central American migrants headed through Mexico to the U.S. border and condemnations of liberal American “mobs” he says oppose him.

DEMOCRATIC PROBES

Every seat in the House was up for grabs on Tuesday and opinion polls had pointed to the Democratic gains. The party with the presidency often loses House seats in midterm elections.

The Republicans had an advantage in Senate races because elections were held for only 35 seats in the 100-member chamber and many of them were in states that often lean Republican.

Republicans built on their slim Senate majority by several seats and ousted at least three incumbent Democrats: Joe Donnelly in Indiana, Heidi Heitkamp in North Dakota and Claire McCaskill in Missouri.

In Florida, Democratic Senator Bill Nelson was trailing his Republican rival, Governor Rick Scott, by a slim margin, with the possibility of a recount looming. Republican Martha McSally was leading Democrat Kyrsten Sinema in the U.S. Senate race in Arizona with some votes still to be counted.