Last week, Ted Cruz dismissed an entire group of Americans from running for president: atheists.

When asked if a fear in God is an important quality for president at the National Religious Liberties Conference in Iowa on Friday, Cruz said, "Any president who doesn't begin every day on his knees isn't fit to be commander in chief of this nation."

It's a bit weird that Cruz would dismiss an entire group of people from running for president because of their religious beliefs (or lack thereof) at a "religious liberties" conference. And it's actually unclear whether most Americans would agree with Cruz — and vote an atheist into the White House. Here's what the polling data says.

Most Americans say they would vote for an atheist

Americans hold relatively negative views toward atheists compared with other groups, but Gallup found in June that 58 percent would be willing to vote for an atheist for president. Only socialists placed below atheists, with all other groups — including Muslims and gay people — higher:

The results put atheists at the bottom but suggest that a slight majority of Americans disagree with Cruz's comments.

Still, that doesn't necessarily mean that an atheist could run for office and win. Saying that you're willing to vote for an atheist is quite different from actually doing it. And Gallup polled US adults — it's unclear whether all of these respondents would all actually vote.

Atheists are among the least respected religious groups

Other data also suggests that many Americans highly disapprove of atheists. As the Pew Research Center found in 2014, Americans on average have relatively cold and negative feelings about atheists — almost as negative as what Pew found for Muslims:

So even though Americans may be willing to vote for an atheist, it's likely a candidate's atheism would weigh him or her down.

Watch: The third Republican debate, explained