Republican presidential hopeful Rick Perry dropped out of the race Thursday and threw his support behind Newt Gingrich, whose campaign is gaining steam ahead of the South Carolina primary on Saturday.

The move gives new fuel to Gingrich and takes some of the wind out of frontrunner Mitt Romney's sails as new results show Romney didn't win the all-important Iowa caucus after all.

Speaking in North Charleston, South Carolina, the Texas governor said Thursday the time had come for him to step aside.

"As I've contemplated the future of this campaign I have come to the conclusion there is no viable path forward for me in this 2012 campaign," Perry told supporters.

"Therefore today I am suspending my campaign and endorsing Newt Gingrich for president of the United States."

He called the former speaker of the House of Representatives a "conservative visionary who can transform our country."

Perry also acknowledged the challenges that Gingrich faces in his battle for the nomination. Though he has performed strongly in the debates and polls show him in second place in South Carolina, his three marriages and admitted infidelities have plagued his campaign.

That negative attention is expected to spike again Thursday when ABC airs an interview with Gingrich's second wife, who is expected to detail his adulteries.

"Newt is not perfect but who among us is? The fact is there is forgiveness for those who seek God," Perry said.

That interview is expected to hurt Gingrich among religious and culturally conservative party members in South Carolina.

Meanwhile Romney, widely considered the frontrunner after his perceived victory in Iowa, lost some momentum Thursday. Romney had originally been declared the winner in Iowa just ahead of Rick Santorum, a former Pennsylvania senator.

However officials said Thursday that Santorum actually won by just 34 votes.

Romney won handily in New Hampshire, which followed Iowa, and looks to have the lead heading into the South Carolina vote.

However, after Thursday's Iowa results clarification he won't be able to say he won the first three states regardless of the outcome in South Carolina, an accomplishment that would have made his campaign virtually invincible.

After South Carolina, the candidates will go on to Florida, where the primary will be held on Jan. 31.

A recent poll released Wednesday showed Romney leading in Florida, followed by Gingrich in second and Santorum in third. Ron Paul was close behind Santorum in fourth place.

Romney's frontrunner status has put him under increasing scrutiny. Though his vast fortune has been touted as proof of his ability to fix the broken U.S. economy, it has also gotten him into trouble.

He recently acknowledged that a portion of his millions is invested in the Cayman Islands, which is often used as a tax shelter by the wealthy.

The remaining candidates will debate on Thursday night.