The end may be nigh for a Harlem church known for hateful public messages condemning gays and President Barack Obama to eternal damnation, and two groups that serve gay New Yorkers are hoping to get an ironic last word on the matter.

They want to buy the Atlah World Missionary Church at a foreclosure auction. One wants to turn it into housing for gay homeless youth.

The congregation's pastor has vowed not to let that happen.

"We're not going to be pushed like this," said Dr. James David Manning, who literally thumped a leather-bound Bible during an interview at his church this week. "I'm tired of people ramming their ideas down one's throat."

A fixture in Harlem for more than 30 years, The Atlah World Missionary Church has never been shy about expressing its own blunt ideas.

The large red billboard in front of the church is emblazoned with rotating messages like one that said to gays "cursed be thou with cancer, HIV, syphilis, stroke, madness, the itch, then Hell." Others have gone after Obama, calling him "a Taliban Muslim illegally elected president."

Manning, who is black, also rails against "sodomites" on the Manning Report, his three-hour daily radio broadcast, and in YouTube videos laced with gay slurs.

So, when the news broke that the church owed $1 million to creditors and was facing a foreclosure auction Feb. 24, some quarters received it with glee.

One nonprofit group, the Ali Forney Center, has raised $175,000 on its website as part of an effort to buy the church and convert the building into transitional housing for homeless gay youths — the very population, its leaders say, that is most harmed by the Atlah church's message.

"We ask our kids why they weren't safe in their homes. ... The No. 1 reason is because of the hostile religious beliefs of their parents," said the center's executive director, Carl Siciliano.

He added that the church location, just a few blocks from the Ali Forney Center's Harlem drop-in center, would be ideal "even if it didn't have the Rev. Manning angle to it."

A second effort to buy the four-story brick and terra cotta church building been organized by the Rivers of Living Water Ministries, which serves mainly African-American LGBT worshippers. The church's GoFundMe drive had raised more than $23,000 as of Friday morning.

Rivers of Living Water shares space with other congregations in an Upper West Side church and needs its own home, said pastor Vanessa Brown, adding that Manning's anti-gay message "causes trauma."

"It's a trigger for people that have been thrown out by churches because of their sexuality and their gender identity," she said.

Manning is vowing to fight what he sees as a politically motivated effort to oust him from the neighborhood he has served for more than 30 years.

In an interview, he said the $1 million he has been told the church owes is nothing but a water bill. "A million-dollar water bill? Imagine that!" he said.

Court documents also show federal tax liens totaling more than $355,000 and other debts. The church had until April 2015 to pay back $1.02 million to creditors, according to court documents.

Manning insisted that the sale will not go forward.

"I don't plan to pay up, but if I had to, I could," he said. "I wouldn't give this building up."

An attorney representing the church, Daniel S. LoPresti of the firm Shaw & Binder, said the firm is taking "all necessary legal steps to protect the church from the foreclosure sale of its property."

If the sale does take place as scheduled, there's far from any guarantee that either the Ali Forney Center or the Rivers of Living Water Ministries would have enough for a winning bid. Harlem real estate, like the rest of New York, has been hot in recent years.

The property could be snapped up by a developer, which might also be seen as an ironic end. Much of Manning's rhetoric is aimed at white gentrification of historically black Harlem.

At least one Harlem neighbor said she'd love to see the church go.

"We'd like this corner to be no longer a corner of hatred, but a corner of compassion," said Stacy Parker Le Melle, who lives across the street and is helping to raise funds for the Ali Forney Center's bid.

Le Melle said the church's signs are hurtful to the community, especially the ones that advocate violence.

"It's not just words," she said. "There are people who are affected by this language. The hate speech creates a climate of terrible possibility."