S.C. Supreme Court Chief Justice Jean Toal fended off a challenge from an associate justice Wednesday, capping off a judicial election that lawmakers say was one of the most contentious in recent memory.

Toal defeated Associate Justice Costa Pleicones for the Supreme Court's chief justice position by a vote of 95-74 in the General Assembly, where 85 voters were needed for a win. Toal's supporters said that tradition had won the day - many had worried about the message it would send to unseat a popular, competent chief justice.

The chief justice not only leads the state's top court but also serves as the chief administrator for the state's entire judicial system.

Toal has promised to step down in December 2015, after she turns 72, the state's mandatory retirement age. Pleicones has said that Toal had promised to retire this year and leave the seat to him. Pleicones is 69, and his current term expires in 2016.

Toal hugged and thanked her supporters outside the House chamber after the vote, saying she was "elated" at the chance to finish key projects, namely the digitization of court records across the state.

She said she's looking forward to finishing those initiatives, and that her relationship with Pleicones, her longtime colleague, wouldn't suffer.

"We kept it on a friendship basis the whole time," Toal said.

Pleicones stood nearby and shook hands with his supporters. He said that he was "disappointed" but looked forward to running again next year and hoped to serve as chief justice for one year before his retirement in 2016.

He praised Toal's "superior political skills and a more effective campaign."

The race in itself was billed as historic because an associate justice had never before challenged a sitting chief justice who nearly everyone agreed was a competent judge. Face-to-face politics played a large role, as leaders in the House jockeyed for votes for their candidates - Rep. Todd Rutherford, D-Columbia, for Pleicones and House Speaker Bobby Harrell, R-Charleston, for Toal.

"I've never seen anything like this," Rutherford said afterward. The vote was particularly precarious for those legislators who appear before judges as attorneys - many of whom have an allegiance to Toal, Rutherford and others said.

Rutherford is an attorney but said he doesn't fear any repercussion.

Sen. Lee Bright, R-Spartanburg, said some members who were undecided went for Toal once they saw the roll call vote trending toward her. "People just wanted to be with the winner," he said. Several lawmakers and aides said that Harrell's influence played a role, as some who were undecided didn't want to cross the powerful speaker.

Lawmakers said that both judges have deep personal relationships with those in the chamber. "Passions ran really high on both sides of this race," Harrell said. Such decisions "are almost always about one on one politics," he added.

Bright said that the vote underscores the need for a more traditional system of selecting judges. South Carolina and Virginia are the only states where the Legislature elects judges.

But the system has a lot of supporters, Harrell among them. "Having this kind of system keeps you from having big swings in philosophy," he said. Other states select judges with the governor's appointment, and Harrell said their party and philosophy can change with every election.

Rumors abounded in the chief justice's election, including that Pleicones was told before the vote that he didn't have the support and he should withdraw his candidacy to avoid embarrassing lawmakers who weren't keen to vote.

Pleicones said that no such offer was ever made. Each side had also accused the other of inflating its vote totals in conversations with other members, adding to the intrigue over what would happen when the final vote was finally taken.

In the end, Pleicones said the race leaves no bitterness - he was headed back to the Supreme Court across the street to work with Toal on a number of cases. "The sun's going to come out tomorrow," he said.