The Senate on Thursday confirmed Steven Menashi to a seat on the U.S. Court of Appeals for the Second Circuit, bringing an end to a confirmation battle that at times drew ire from members of both parties toward the judicial nominee.

The Senate confirmed Menashi 51 to 41, largely along party lines. Sen. Susan Collins, R-Maine, broke with her party to vote against the nominee. Menashi's confirmation flips the Second Circuit to a majority of Republican appointees.

Senate Majority Leader Mitch McConnell, speaking on the Senate floor ahead of Menashi's vote, said the nominee had advanced from the Senate Judiciary Committee "on the basis of strong academic and legal qualifications," including "experience in both teaching and practicing law

"I would urge all of our colleagues to vote to confirm this impressive nominee this afternoon," McConnell said.

However, Democrats have been highly critical of Menashi, citing his past writings and actions as counsel at both the U.S. Education Department and the White House. Sen. Dianne Feinstein, the ranking member of the Senate Judiciary Committee, urged other senators to vote against the nomination in a statement Wednesday.

"Mr. Menashi should not be rewarded for providing such bad legal advice with a lifetime appointment to the federal bench," Feinstein said.

The Senate Judiciary Committee narrowly advanced his nomination along party lines last week.

Menashi faced criticism over his writings going as far back as college, including a 2010 law review piece critical of "ethnically heterogeneous societies."

And one day before he was voted out of committee, The New York Times reported that Menashi wrote a legal memo while he was acting general counsel for the Department of Education that laid out how Social Security data could be used to block students from obtaining debt relief. A federal judge struck down the plan.

Menashi also drew bipartisan frustrations during his nomination hearing with the Senate Judiciary Committee in September. A current attorney in the White House counsel's office, Menashi repeatedly declined to reveal even the topics that he offered legal advice on for the White House, citing executive privilege.

After prodding by Senate Judiciary Committee chairman Lindsey Graham, R-South Carolina, Menashi did acknowledge that he sometimes gave advice on topics like immigration. But the lack of candor during the questioning raised eyebrows from those on both sides of the aisle, including GOP Sen. John Kennedy. Kennedy ultimately voted to advance Menashi out of committee.

Democrats also raised concerns about whether Menashi was involved in an alleged cover-up by White House lawyers of Trump's July call with Ukrainian President Volodymyr Zelensky. The call is at the heart of the House's impeachment inquiry, as Trump asked Zelensky to investigate his political rival, former Vice President Joe Biden and Biden's son, Hunter.

Collins, who voted against the nominee, had said in October that she wouldn't support Menashi. She said his "past writings, particularly about women, LGBTQ advocates and diversity, raise questions about whether he has the appropriate judicial temperament."

Trump announced in August that Menashi would be his nominee for a seat on the Second Circuit. A former Kirkland & Ellis partner, Menashi previously clerked for U.S. Supreme Court Justice Samuel Alito and Judge Douglas Ginsburg of the U.S. Court of Appeals for the D.C. Circuit.

Read more: