WASHINGTON -- Donald Trump is going with with a former critic for a key foreign policy post, picking South Carolina Gov. Nikki Haley to be U.S. ambassador to the United Nations.

Haley, 44, who won election to the governor's post as part of the Tea Party wave in 2010, criticized Trump during the campaign and endorsed Florida Sen. Marco Rubio during the South Carolina primary. She later backed Trump opponent Ted Cruz.

At one point, Haley called Trump one of the "angriest voices" in politics and criticized his "irresponsible talk," including his call to temporarily ban Muslims from entering the United States.

Haley was critical of Trump during the primary campaign, calling him one of the "angriest voices" and accusing him of contributing to "irresponsible talk." She also denounced Trump's plan to issue a temporary ban on Muslims entering the U.S.

An official familiar with the Trump transition confirmed the pick, speaking on condition of anonymity pending a formal announcement later Wednesday.

South Carolina Republicans praised the selection.

Bruce Haynes, a GOP consultant from South Carolina, called Haley "one of the brightest and hardest working leaders in the Republican Party," and will be "an incredibly valuable addition" to the Trump administration.

While she and Trump have differences, "people forget Haley rose to stardom as an anti establishment candidate, a young state Senator who beat older more experienced Republican candidates to become Governor," said Haynes, founding partner of Washington-based Purple Strategies. "So while she has been critical of Trump at times, she's a fellow political outsider."

Haynes also noted that Trump's latest appointment "signals a step toward diversity in age, gender, race and points of view."

As a woman and daughter of Indian immigrants, Haley would bring a dash of diversity to Trump's appointments, which so far have uniformly consisted of white males.

Trump had interviewed Haley for secretary of State. Among other candidates for the top diplomatic post: Former Republican presidential candidate Mitt Romney, Sen. Bob Corker of Tennessee, and former New York City Mayor Rudy Giuliani.

Haley has little foreign policy experience, but supporters noted she traveled abroad at least eight times during her two terms as South Carolina governor. Her husband was deployed to Afghanistan in 2013 as a member of the S.C. National Guard, the Post and Courier reported.

If the Senate confirms Haley as U.N. ambassador, she would be replaced as South Carolina governor by Lt. Gov. Henry McMaster -- a prominent supporter of Trump.