WASHINGTON — The Senate on Tuesday confirmed one of President Donald Trump’s legal advisers to serve on what is often described as America’s second highest court.

The vote to confirm Gregory Katsas, 53, of Virginia, was 50-48.

Katsas has worked on some of the president’s most contentious decisions, including his executive orders restricting travel for citizens of predominantly Muslim countries and his decision to end a program protecting some young immigrants from deportation.

Democratic lawmakers argued that they don’t trust Katsas will be truly independent in cases involving the president, but they were relatively powerless to stop his confirmation as only a simple majority is needed to advance a judicial nominee. In the end, Republicans used their majority to prevail with Sen. John Kennedy of Louisiana being the only Republican to vote no and Sen. Joe Manchin of West Virginia being the only Democrat to vote yes.

Katsas serves as deputy assistant to the president and deputy counsel. He sought to assure lawmakers during his confirmation hearing that he will recuse himself from any cases that overlap with his work at the White House.

He would replace conservative Judge Janice Rogers Brown on the U.S. Court of Appeals for the District of Columbia Circuit. The court is influential, in part because it adjudicates many of the orders and laws put forth by the administration. It can be a stepping stone to the Supreme Court just a few blocks away.

Katsas, once a law clerk to Supreme Court Justice Clarence Thomas, has served in high-ranking Justice Department jobs, including as head of the civil division that has responsibility for defending the administration’s policies against court challenges. He is part of the steady stream of Jones Day law firm partners who have flowed into the Trump administration.

Senate Majority Leader Mitch McConnell has made it a priority to push through more of the president’s nominees after conservative groups voiced frustration with the pace of confirmations in the Republican-controlled Senate. More than most legislation, filling lifetime posts on the courts is a presidential legacy that reverberates for decades.

With the outcome all but completed, there was little debate over Katsas’ confirmation on the Senate floor Tuesday despite the close vote. Democratic Sen. Mazie Hirono of Hawaii said Katsas had a “disturbing record of pushing a partisan, conservative agenda not based on sound law.”

McConnell noted that Katsas served as a deputy assistant attorney general in the Justice Department when George W. Bush was president. McConnell said Katsas received the highest award given by the department for his work overseeing hundreds of lawyers and some of the government’s most complicated civil litigation.

Katsas is the ninth appellate court nominee to win confirmation during Trump’s presidency. At the same stage, President Barack Obama had secured three such confirmations.