A conservative megachurch pastor was wiped from the inaugural program Thursday after a strongly anti-homosexuality sermon he gave in the 1990s surfaced, evidence of how fast Americans’ views on gays and lesbians are shifting and the political pitfalls for a liberal president attempting to reach out to religious conservatives.

In naming Atlanta evangelical Louie Giglio two days earlier to give the Jan. 21 benediction prayer, President Obama noted Giglio’s success at bringing tens of thousands of college students to events aimed at stopping human trafficking.

Within 24 hours, several progressive and gay rights groups were noting Giglio had preached to “lovingly but firmly respond to the aggressive agenda” of gay activists. He warned that legal gay marriage would “run the risk of absolutely undermining the whole order of our society.”

On Thursday morning, Giglio issued a withdrawal statement emphasizing that the sermon was more than 15 years old and that the topic of homosexuality “has not been in the range of my priorities” in recent years. But he did not disavow its contents.

Inaugural committee spokeswoman Addie Whisenant said in a statement that officials were unaware of the sermon when Giglio was picked and “they don’t reflect our desire to celebrate the strength and diversity of our country at this Inaugural. . . . As we now work to select someone to deliver the benediction, we will ensure their beliefs reflect this administration’s vision of inclusion and acceptance for all Americans.”

Atlanta Rev. Louie Giglio, who was to deliver the benediction at President Barack Obama’s inauguration, withdrew from the ceremony after gay and lesbian groups protested anti-gay remarks he had made in the 1990s. (Lee Steffen/Via AP)

The White House and inaugural officials would not comment on whether Giglio’s withdrawal was mandatory, and Giglio’s Passion City Church did not return requests for comment. But a gay rights advocate close to the Obama administration said the White House was particularly sensitive to the matter in light of recent controversy about anti-gay statements made by its nominee for defense secretary, Chuck Hagel.

The quick departure of Giglio from one of the country’s most prominent prayer platforms shows how much has changed from four years ago, when Obama selected prominent evangelical Rick Warren to pray at his historic swearing-in. The best-selling author and megachurch leader had been outspoken against the march of legal gay marriage and controversy ensued. Neither Obama nor Warren pulled back, however.

But between 2006 and 2012, the percentage of all Americans who support same-sex marriage has climbed from 36 to 53, according to a Washington Post-Kaiser Family Foundation poll.

And those who say gay and lesbian “relations” are morally acceptable has gone from 48 percent to 54 percent.

Obama was an opponent of same-sex marriage when he was elected.

The quick pullback of Giglio, to some, signaled a tipping point.

“The whole subtext behind this is the dramatic ways in which the whole conversation and public sentiment have changed over the last decade on this very issue,” said Randall Balmer, a historian of American religion at Dartmouth College.

There were clear political reasons for Obama to avoid picking a conservative evangelical such as Giglio for such a prominent role.

Democrats and independents are even more likely to support legalizing same-sex marriage. Gay rights activists also have become important supporters of the president. And white evangelicals, who make up about 20 percent of the adult population, went 78 percent in the fall for Obama’s election opponent, Republican Mitt Romney.

But Obama has made symbolic efforts throughout his presidency to include religious conservatives, particularly evangelicals.

Now some are interpreting Giglio’s withdrawal as a rejection of religious conservatives who don’t accept homosexuality — regardless of what other good works they do.

“Is Mother Teresa now banned? ” said Ed Stetzer, president of the Christian research firm LifeWay Research. “We’re in a post-Rick Warren era.”

While his views on the topic now are unclear, Giglio’s language on homosexuality appears to have changed over time.

In the mid-1990s sermon (whose location of delivery was not clear), he called homosexual relationships immoral and said gays and lesbians are “not entitled to be recognized as a married couple and a family under God that can adopt children and have co-benefits in your health insurance plans and live as if that were a normal thing in this society.”

But in a statement Thursday on his church site, Giglio said his work “in the last decade” has been one of inclusion.

“I am constantly seeking to understand where all people are coming from and how to best serve them as I point them to Jesus. . . . In all things, the most helpful thing I can do is to invite each of us to wrestle with scripture and its implications for our lives. God’s words trump all opinions, including mine.”

That decades have passed since Giglio delivered the sermon in question made little impression on critics, who believed his selection was out of step with the times.

Dana Perlman, a gay man who was a bundler for Obama, said he prefers “to see someone do the invocation who has said things that are supportive of all constituencies and all Americans.”

Fred Sainz, vice president at the Human Rights Campaign, said Giglio’s past statements are “not in keeping with the tone this president wants to set for his inaugural.”

Ross Murray, director of the program on religion at the Gay & Lesbian Alliance Against Defamation, said he didn’t want to set up a “false frame” that a person has to be “Christian or pro-gay,” but felt without a disavowal from Giglio, an inaugural prayer would send a subtle message to gays and lesbians: “God bless America, except for them.”

Elizabeth Tenety and Scott Clement contributed to this report.