In this May 5, 2020, photo, Rep. John Ratcliffe, R-Texas, testifies before the Senate Intelligence Committee during his nomination hearing on Capitol Hill in Washington. Credit: Andrew Harnik | AP

WASHINGTON — The Senate on Thursday confirmed Texas Rep. John Ratcliffe as director of national intelligence, installing a new head of the nation’s intelligence agencies at a time when President Donald Trump has ousted multiple officials.

Ratcliffe seemed unlikely to get the position when he was nominated in February, as he had already been nominated for the job last year and then withdrew after Republicans questioned his experience. But senators warmed to him as they grew concerned about upheaval in the intelligence community under Trump and wanted a permanent, confirmed director.

The Texas Republican will replace Richard Grenell, the current acting director who has overseen many of the personnel changes. The last Senate-confirmed director, former Indiana Sen. Dan Coats, left the post last summer after clashing with Trump.

Democrats allowed a quick vote on the nomination this week, dropping their usual procedural delays in a signal that they prefer Ratcliffe over Grenell. But most Democrats still opposed his nomination, making Ratcliffe the first DNI not to win broad bipartisan support since the position was first created in 2005. The vote was 49-44.

Democrats said they were skeptical that Ratcliffe would be an independent leader, despite his assurances during his confirmation hearing. The Republican has been an ardent defender of the president through House impeachment and investigations into Russian interference.

Ratcliffe worked to separate himself from the president at his confirmation hearing, including by saying he believed Russia interfered in the 2016 presidential election, a conclusion Trump has resisted. He said he would communicate to Trump the intelligence community’s findings even if he knew Trump disagreed with them and might fire him.

Still, the position carries unique challenges given the president’s seeming inclinations to politicize intelligence and to bend intelligence agencies to his will. Trump has openly rejected intelligence community assessments at odds with his own viewpoint, including on the Russian interference.

Trump has also shown himself as eager to have intelligence agencies investigate matters that he hopes will support his political positions, with agencies now trying to determine whether the coronavirus pandemic emerged in a laboratory in China or from a market.

In addition, the DNI is encountering ongoing political pressure, including from Republicans in Congress, to declassify and make public information from the Russia investigation that Trump allies hope will cast senior Obama administration officials — including former vice president and 2020 opponent Joe Biden — in a negative light.

Last week, for instance, Senate Republicans released a newly declassified list of former intelligence officials who requested the identity of an American from intelligence reports who turned out to be former Trump administration national security adviser Michael Flynn. On Tuesday, Republicans released a January 2017 memo that Susan Rice, President Barack Obama’s national security adviser, wrote to herself documenting a sensitive conversation about Flynn and his Russian contacts that she participated in earlier in the month with Obama and then-FBI Director James Comey.

And there have been calls from Democrats, and Flynn’s own lawyer, to release declassified transcripts of intercepted phone calls during the presidential transition period between Flynn and then-Russian Ambassador Sergey Kislyak. Flynn pleaded guilty to lying to the FBI about those communications, though the Justice Department has since moved to dismiss the case. Demands to make that information public could confront Ratcliffe in his new role.

“No lawyer for Flynn has ever seen it or heard the recording” of the call, Flynn’s lawyer, Sidney Powell, said in an email to The Associated Press. ” I would want both.”