Susan Rice, the embattled U.S. ambassador to the U.N., withdrew her name on Thursday from consideration to be secretary of state in the face of angry Republican opposition.

"If nominated, I am now convinced that the confirmation process would be lengthy, disruptive and costly—to you and to our most pressing national and international priorities," Rice wrote in a letter to President Barack Obama. (NBC News first reported the news.)

Obama had not formally nominated her, but Rice was the favorite for the post and spent time on Capitol Hill trying—vainly—to placate her Republican critics. The move leaves Democratic Sen. John Kerry, who chairs the Senate Foreign Relations Committee, as the likely front-runner.

In a statement, Kerry praised Rice as "an extraordinarily capable and dedicated public servant" and underlined that "today's announcement doesn't change any of that."

"As someone who has weathered my share of political attacks and understands on a personal level just how difficult politics can be, I've felt for her throughout these last difficult weeks, but I also know that she will continue to serve with great passion and distinction," Kerry said.

Obama confirmed her withdrawal in a statement on Thursday afternoon, saying: "While I deeply regret the unfair and misleading attacks on Susan Rice in recent weeks, her decision demonstrates the strength of her character, and an admirable commitment to rise above the politics of the moment to put our national interests first."

Talk of Rice being nominated to succeed Secretary of State Hillary Clinton stirred significant controversy due to Rice's role in the handling of the Sept. 11, 2012, attack on the U.S. Consulate in Benghazi, Libya. The assault claimed the lives of Ambassador Chris Stevens and three other Americans.

Republicans accused Rice of misleading the public about intelligence that indicated the attack was premeditated. (The Obama administration has also been accused of ignoring requests for increased security at the American compound.) The White House steadfastly denied deliberately misleading the public.

Story continues

Rice's withdrawal amounted to a painful postelection defeat for Obama, who had staunchly defended Rice and even vowed to nominate her over Republican objections if he concluded that she was the best person for the job. It will be viewed as a win for Arizona Republican Sen. John McCain and other Republican senators who had vowed to block Rice's confirmation.

McCain spokesman Brian Rogers emailed Yahoo News to express that the senator "thanks Ambassador Rice for her service to the country and wishes her well. ... He will continue to seek all the facts about what happened before, during and after the attack on our consulate in Benghazi that killed four brave Americans."

Republican Sen. Lindsey Graham of South Carolina, another leading Rice detractor, declared in a statement on Thursday, "I respect Ambassador Rice's decision." Graham said Obama "has many talented people to choose from" to succeed Clinton.

Graham has accused the administration of stonewalling efforts to look into the Benghazi attack and vowed to keep "working diligently to get to the bottom of what happened."

If Obama picks Kerry, that could touch off a political war in Massachusetts for his Senate seat. Republican Sen. Scott Brown, defeated on Nov. 6 by Democrat Elizabeth Warren, could make a play for that spot.

Obama is expected to overhaul much of his foreign policy and national security teams for the coming term. Defense Secretary Leon Panetta is departing, the position of director of the CIA is open after the David Petraeus scandal and Homeland Security Secretary Janet Napolitano is rumored to be looking to replace Attorney General Eric Holder.