Rick Santorum and Rick Perry finished near the bottom in Tuesday's New Hampshire primary.

Santorum, who pulled off a last-minute upset when he lost in Iowa last week to Mitt Romney by just eight votes, was pushed back to near the bottom of the pack in moderate New Hampshire.

“We knew it would be tough,” Santorum told a sparse crowd attending his election night party.

While Santorum appealed to socially conservative voters in Iowa, his message failed to resonate in more liberal New Hampshire.

At venue after venue throughout the week, Santorum was challenged on his opposition to gay marriage and protesters lined up outside several appearances.

Santorum drew roughly 9 percent of the vote, finishing behind fourth place finisher Newt Gingrich.

Rick Perry trailed far behind Santorum with less than 1 percent of the vote.

The Texas governor quickly dismissed the primary results as he campaigned in South Carolina.

“Tonight's results in New Hampshire show the race for 'conservative alternative' to Mitt Romney remains wide open. I skipped New Hampshire and aimed my campaign right at conservative South Carolina,” Perry said in a statement. “I have a head start here.”

“South Carolina picks presidents,” he added.

Perry and Santorum have signed The Family Leader's 14-point pledge which asks presidential candidates to “vigorously” oppose marriage equality. The document's footnotes suggest that being gay is a choice that may have a negative impact on public health.

Both have also said they would reinstate “Don't Ask, Don't Tell,” if elected president.

Michele Bachmann, who ended her bid for the White House after a disappointing Iowa finish, came in seventh in New Hampshire.