The Senate on Thursday confirmed Rep. Mick Mulvaney to serve as President Trump’s director of the Office of Management and Budget.

The South Carolina Republican was narrowly confirmed in a 51-49 vote.

This comes a few weeks after he testified at his confirmation hearing where he argued that significant changes needed to be made to entitlement programs like Social Security, Medicare and Medicaid, putting him at odds with the president who campaigned on preserving those programs. During the hearing, Mulvaney also said that tax increases would be an option under the Trump administration despite Mr. Trump vowing during his election race to cut taxes.

Get Breaking News Delivered to Your Inbox

Sen. John McCain, R-Arizona, was the sole Republican who opposed Mulvaney’s nomination because of his advocacy for budget cuts to the military. McCain serves as the chairman of the Senate Armed Services Committee.

“In 2013, Congressman Mulvaney succeeded in passing an amendment to cut $3.5 billion from the defense appropriations bill. His website featured an article touting the achievement. But when asked about that vote during his confirmation hearing, Congressman Mulvaney said he didn’t remember that amendment. I think anyone who treats our national defense with the seriousness it deserves would remember a vote like that,” McCain said on the Senate floor Wednesday.

No Democrat or independent senator voted in favor of his nomination Thursday.

As OMB director, Mulvaney will be charged with overseeing government spending, which Mr. Trump has said he’d like to increase for at least defense programs.