Texas Gov. Rick Perry is out with a new television ad in Iowa that accuses President Obama of engaging in a “war on religion” and criticizes his decision to overturn the “Don’t Ask, Don’t Tell” policy for gays in the military.

“I’m not ashamed to admit that I’m a Christian,” the Texas governor says in the spot. “But you don’t have to be in the pew every Sunday to know that there’s something wrong in this country when gays can serve openly in the military, but our kids can’t openly celebrate Christmas or pray in school. As president, I’ll end Obama’s war on religion, and I’ll fight against liberal attacks on our religious heritage.”

Bill Burton, a former Obama White House aide who now runs a super PAC supportive of the president, tweeted that the Perry ad was “astonishingly intolerant”.

Religion is often a tricky subject for presidential candidates — even in a Republican primary.

In the 2008 race, when former Arkansas governor Mike Huckabee debuted a Christmas ad in which the shape of a cross appeared in the background (by happenstance, Huckabee’s ad team said), some accused him of subtly — or not so subtly — using religion as a means to win votes.

Perry, of course, has often straddled this line in his campaign (and before it). He held a large gathering of evangelicals at Reliant Stadium in Houston shortly before entering the presidential race. And, early in his campaign, a pastor who was supporting Perry suggested former Massachusetts governor Mitt Romney’s Mormon religion was a cult.

Of course, part of the coverage of the ad — whether intentional on the part of Perry’s campaign or not — will re-inject religion into the Republican race.

Many Romney backers are convinced that his religion hurt him among Iowa’s social conservatives in his 2008 bid and, while former House Speaker Newt Gingrich is a converted Catholic, he has been married three times.

Perry needs help to return to the ranks of frontrunners with recent polling in Iowa showing him hovering around 10 percent in what amounts to a make-or-break state for him. And, as we have written before, his best/only path back to viability is painting himself as the most outspoken critic of President Obama.

This ad, the leading edge of a $1 million ad buy in the state by Perry over the final month of the campaign, is his attempt to do just that.