The Senate confirmed the next commissioner of the Internal Revenue Service on Wednesday, giving the agency a new leader as it struggles to cope with steep funding cuts and execute the sprawling Republican tax law passed last fall.

Charles Rettig, a California tax attorney, was chosen for the post by President Trump in February for a term that runs until 2022. He was confirmed in a 64-to-33 vote.

Rettig was an attorney at the Beverly Hills, Calif.-based law-firm Hochman, Salkin, Rettig, Toscher & Perez for more than 30 years, and he has often represented taxpayers in disputes with the IRS. He has also served on an advisory board to the IRS that reviews tax policy.

Rettig’s position as commissioner comes at a pivotal moment for the agency. The IRS budget has been cut steadily in recent years, with staff levels falling by more than 16 percent in five years, largely due to the refusal of Republicans in Congress to fund it under President Obama. Congress did marginally increase the IRS budget this year, in part to help it oversee the immensely complex GOP tax law.

“Rettig will face some huge challenges,” said Marvin Friedlander, who spent nearly two decades as an IRS official. “The big picture is: How can he keep this agency running on a tight budget while implementing this complicated new law?”

Rettig will also probably face questions about Trump’s tax returns, which the president refused to release during the 2016 campaign. Democrats have pushed to release the returns, with some promising to pass legislation to do so should they take control of Congress in this year’s midterm elections.

Democrats used Rettig’s hearings to criticize a new rule to loosen nonprofit donor disclosure requirements. The rule was recently announced by the Treasury Department.

“This is not a typical IRS commissioner debate,” said Sen. Ron Wyden (D-Ore.), the top Democrat on the Senate’s finance committee. “Over the last several months, the Trump administration has weaponized the tax code to punish its political adversaries and benefit shadowy, far-right groups.”

Rettig will also be faced with improving the IRS’s outdated IT systems. A high-profile glitch on Tax Day shut down some of the IRS systems and delayed millions of taxpayers as they tried to submit their returns online.

“Recent memory reminds us just how important it is that all Americans get a fair shake from the agency that oversees the tax code,” said Senate Majority Leader Mitch McConnell (R-Ky.), speaking in support of Rettig. “This historic new law makes it all the more important the IRS continue to modernize and improve its technological infrastructure.”

Erica Werner contributed to this report.