Sen. Charles E. Grassley (R-Iowa) announced Friday that he will give up the chairmanship of the Senate Judiciary Committee next year in favor of assuming the top spot on the Senate Finance panel — a move that will probably put the Judiciary gavel in the hands of Sen. Lindsey O. Graham (R-S.C.), once one of President Trump’s harshest critics, but lately one of his closest allies in Congress.

Graham has announced his intention to run for chairman, though he has not officially been selected as the next head of the panel. In a tweet Friday, he said that, if selected, “I will push for the appointment and Senate confirmation of highly qualified conservative judges to the federal bench and aggressive oversight of the Department of Justice and FBI.”

The GOP has been confirming record numbers of conservative judges — including two Supreme Court justices — to the federal courts, a pursuit Senate Majority Leader Mitch McConnell (R-Ky.) identified as the party’s top priority.

Graham emerged as a firebrand champion of the effort during a Judiciary panel hearing on sexual assault accusations against then-Supreme Court nominee Brett M. Kavanaugh, in which Graham angrily dismissed the allegations and proceedings as “crap,” a “charade” and “the most despicable thing I have seen in my time in politics.”

But judges are not the only matter that will be on the Judiciary Committee’s agenda next year. Early on, the panel will probably have to consider a nominee to become attorney general, after Trump fired Jeff Sessions from the post and appointed his former chief of staff, Matthew G. Whitaker, to serve as acting attorney general.

The committee also will probably have to oversee special counsel Robert S. Mueller III’s probe of Russian meddling in the 2016 election. Lawmakers on both sides of the aisle have called for Whitaker’s recusal from that investigation because of past statements he has made dismissing it, but Graham has refused to join their number. After a meeting with Whitaker on Thursday, Graham said he was “not buying into this hysteria” over Whitaker’s appointment, adding that Whitaker is “not going to do anything draconian” to Mueller’s investigation.

Graham has moved closer to Trump over the course of his presidency, even endorsing the creation of a second special counsel to investigate charges that bias and unprofessionalism affected the FBI and Justice Department’s investigations of Trump’s campaign and former secretary of state Hillary Clinton’s use of a private email server. But the sharp-tongued senator has also been a stalwart defender of Mueller’s probe, cautioning the president against making any moves to undermine it and even co-authoring a bill to put any decision to fire a special counsel to the courts.

Earlier this week, Sen. Jeff Flake (R-Ariz.), who sits on the Judiciary Committee, said that he would not vote to advance any of Trump’s judicial nominees until the special counsel protection bill received a vote on the Senate floor. Graham said Thursday that he would like to see Flake get that vote.

“I don’t believe that Mueller’s in jeopardy . . . but from a policy point of view, I think this is good policy, no matter who the special counsel is,” Graham said Thursday.

As chairman, Graham will have the authority to launch investigations of the issues surrounding the Russia probe, and, once completed, the work of Mueller’s probe. Graham also will be in a position to push forward legislation on other matters he has advocated, such as criminal-justice reform, if it fails to pass this year.

On Thursday, Graham said that if the Senate voted on the bill now, “I think you’d get 80 votes.” He added that he hoped Congress would pass such legislation this year so lawmakers could avoid starting from scratch at the beginning of next year.

Grassley had the option of staying on as Judiciary chairman next year, under Senate Republican rules that limit senators from serving as panel leaders for more than six years. But he opted to move back to the Finance Committee — where he has been both chairman and ranking member — for the next two years.

In a statement announcing his decision, he said his motivation was to try to capi­tal­ize on the improved economy, “to make sure that as many Americans as possible get to experience this good economy for themselves.” Grassley listed tax policy, small-business investment opportunities, expanded market access for farmers and manufacturers, and expanded health-care access for rural communities among his top priorities as chairman.

“There’s always more that can be done to help make life better for and empower every individual and family,” he said in the statement.