Minnesota Representative Michele Bachmann won the Ames, Iowa straw poll on Saturday, a test of strength among the Republican presidential candidates five months before the state's caucuses kick start the GOP presidential nominating season.

The nonbinding Iowa mock elections were the first indication of what Iowans thought of the Republican presidential hopefuls. Which candidate will win the Iowa winter contest, or be chosen by the Republican Party as its presidential candidate is yet to be seen. But the straw poll revealed that Bachmann has garnered strong support in Iowa.

Bachmann got 4,823 votes and barely managed to edge out Texas Rep. Ron Paul by a slim margin of 152 votes. Ron Paul came in second with 4,671 votes. Minnesota Gov. Tim Pawlenty finished third with 2,293 votes. Pawlenty had a lot riding on the poll and said that the mock poll would show his campaign's momentum, according to a Time magazine report. Trailing behind Bachmann and Paul by such a large margin even in a test poll is a setback for the governor.

Texas Gov. Rick Perry, who wasn't on the Ames ballot, declared his candidacy the same afternoon in Charleston, S.C., with a scathing attack on President Obama.

"We cannot afford four more years of this rudderless leadership," Perry told a conference of South Carolina voters.

"I full well believe I'm going to win. It's time to get America working again. America is not broken. Washington, D.C. is broken," he said.

Perry is a staunch social conservative and the longest surviving governor in Texas history. He brought about job growth in Texas, which has surpassed those of other states in recent years. Perry finished sixth in the straw poll with 718 write-in votes even though he was not on the ballot. However, he managed to stay ahead of Mitt Romney, who was on the ballot and received 567 votes even though he did not participate.

They were both trailed by Newt Gingrich, Jon Huntsman and Thaddeus McCotter.

Finishing fourth was former Senator Rick Santorum, with businessman Herman Cain in fifth ahead of Perry.

The quadrennial straw poll was held in the Hilton Coliseum at Iowa State University.

Six Republican candidates, who reserved space at the straw poll to guarantee placement included Michele Bachmann, Herman Cain, Thaddeus McCotter, Ron Paul, Tim Pawlenty, Rick Santorum. The three nonparticipants, whom the Iowa Republicans voted to place in contention were Mitt Romney, Jon Huntsman Jr., Newt Gingrich.

The straw poll is essentially a fundraiser for the Iowa Republican Party. The six Republicans, who had participated in the poll, asked for support from voters, who came to the site in dozens of buses and crowded the candidates' tents.

It was a political festival with a carnival like atmosphere. Candidates made speeches throughout the day, seeking support by offering solutions to high unemployment, rising debt and volatile stock markets.

There were long lines outside the tents hosted by Pawlenty and Bachmann, who competed for the votes of the social conservatives, who dominate the Iowa nominating contest. Libertarian Paul also addressed a packed arena when he spoke.

Bachmann emphasized her Iowa roots, her faith as well as her opposition to abortion and gay marriage to garner support.

Republican candidates did their best to win over the Iowans. A Los Angeles Times report described that the candidates "strolled the fairgrounds, sampled pork chops on a stick, deep-fried butter on a stick and cheesecake on a stick, threw on grilling aprons, and did a lot of grinning and gripping with potential voters."