The Senate voted 62 to 35 on Thursday to confirm former Yale Law School Dean Harold Hongju Koh for the position of legal adviser to the Department of State.

The vote ends an unexpectedly heated three-month confirmation battle in which some Republicans alleged Koh would subvert American sovereignty in favor of international law in his new position. Thursday’s vote was split mostly along party lines, with five Republicans joining the Democratic majority in favor of Koh’s nomination.

[ydn-legacy-photo-inline id=”10453″ ]

“I feel like I am setting sail on a thrilling new adventure,” Koh wrote in an e-mail message to the Law School community following the vote. “One former Legal Adviser once described his job as ‘speaking law to power.’ I pledge to you to do my very best to bring the enduring values of our Law School to serve our country in facing its global challenges.”

The vote came three days after University President Richard Levin announced the appointment of Koh’s successor, Robert Post LAW ’77, who will take office next week as the 16th dean of the Law School.

Although Koh received the Senate’s unanimous support when he was nominated for the position of assistant secretary for democracy, human rights and labor under the Clinton administration in 1998, Koh’s return to public service over a decade later has proven much more contentious.

Hours after Koh’s successor was named Monday, Senate Majority Leader Harry Reid issued an ultimatum to Senate Republicans, saying he planned to force a vote on Koh’s nomination this week whether they liked it or not. Several Republicans have sought to block Koh’s nomination over the past two months, both while it was under consideration by the Senate Foreign Relations Committee and when it came before the full Senate.

A motion to invoke cloture on Koh’s nomination passed Wednesday morning, making Koh’s nomination a virtual certainty.

“I really regret that some of the accusations and insinuations against Dean Koh have simply gone over any line of reasonableness or decency,” Sen. John Kerry ’66 said before the cloture vote. “Dean Koh deserves a better debate than he has been given thus far.”

Much of the criticism aimed at Koh centered on comments he allegedly made at a 2007 Yale alumni dinner indicating his support of the use of Shariah law in U.S. courts. Those at the event denied that Koh had made any such comments, but that did not stop the outpouring of criticism from conservative Republicans.

Nonetheless, the Foreign Relations Committee voted 12-to-5 last month to send Koh’s nomination to the full Senate, with the senators split almost exactly along party lines. Sen. Richard Lugar of Indiana, the ranking member of the committee, was the only Republican to vote with the Democrats in support of Koh.

Lugar and four other Republicans — Susan Collins of Maine, Mel Martinez of Florida, Olympia Snowe of Maine and George Voinovich of Ohio — backed Koh’s nomination Thursday. Senate Democrats unanimously voted in favor of Koh’s confirmation, with the exception of Sen. Ted Kennedy and Sen. Robert Byrd, who were absent because of illness.

With his appointment now official, Koh will go on public service leave from his professorship, effective Friday.

“Yale Law School’s great loss is the nation’s great gain,” Post said in a statement following the vote. “Our thoughts and prayers go with Harold as he begins this new journey. We have confidence that he will make enormous contributions to the development of the rule of law in the world.”

Koh has said he plans to return to the Law School faculty when he leaves the State Department.

Zeke Miller contributing reporting.