By Anna Driver

HOUSTON (Reuters) - Exxon Mobil Corp said on Friday it will extend benefits to spouses of workers and retirees in same-sex marriages in the United States, a sweeping and symbolic change by a corporate titan following a landmark Supreme Court ruling in June.

Though dozens of U.S. corporations, especially progressive ones like Apple Inc, have offered domestic partner benefits to gay couples for years, the step at Exxon, the world's largest publicly traded oil company, was heralded by gay rights groups as especially significant.

Exxon had long avoided extending the gay marriage benefits in the United States, saying its policies were governed by federal laws.

Before Friday's announcement, Exxon had recognized gay marriages in some 30 countries around the world where it operates and where same-sex unions are legal, but it had not recognized same-sex marriage in U.S. states that allow gay marriage.

But critics said the company, headquartered in conservative Texas, had been dragging its feet - especially because peers like Chevron Corp and Royal Dutch Shell are known for their liberal policies for gay and transgender workers.

Exxon was prompted to revise its stance for its U.S. workers after the Supreme Court struck down a key portion of the Defense of Marriage Act, which had defined marriage as between a man and a woman. That led to same-sex couple eligibility for federal benefits.

The company itself described the move as reflecting a change in U.S. policy, not its own.

"We have made no change in the definition of eligibility for our U.S. benefit plans. Spousal eligibility in our U.S. benefit plans has been and continues to be governed by the federal definition of marriage and spouse," it said in a statement announcing it would recognize "all legal marriages".

The Pride Network, a gay rights group, celebrated Exxon's change via Twitter.

The Human Rights Campaign has in the past blasted Exxon for scrapping Mobil's anti-discrimination policy that protected gay workers after Mobil was acquired in 1999.

In August, retailer Wal-Mart Stores Inc also moved to extend benefits to people within same-sex marriages.

A New Jersey judge on Friday ordered state officials to allow same-sex couples to marry starting October 21, saying the current civil union system unfairly deprives them of federal benefits available to married couples.

(Writing by Terry Wade; editing by Peter Henderson and Matthew Lewis)