WASHINGTON (Reuters) - All legal same-sex marriages will be recognized for U.S. federal tax purposes, the Obama administration said on Thursday, allowing married gay couples to claim the same tax benefits as their heterosexual peers.

As expected after a landmark Supreme Court ruling in June, the U.S. Treasury and Internal Revenue Service said:

"The ruling applies regardless of whether the couple lives in a jurisdiction that recognizes same-sex marriage or a jurisdiction that does not recognize same-sex marriage."

The ruling comes just weeks after the Supreme Court on June 26 invalidated a key portion of a 1996 federal law, known as the Defense of Marriage Act, that barred recognition of gay marriages.

There was some uncertainty after the Supreme Court ruling about how the tax status of gay married couples would be treated in states that do not allow gay marriage.

"Today's ruling provides certainty and clear, coherent tax filing guidance for all legally married same-sex couples nationwide. It provides access to benefits, responsibilities and protections under federal tax law that all Americans deserve," Treasury Secretary Jack Lew said in a statement.

"This ruling also assures legally married same-sex couples that they can move freely throughout the country knowing that their federal filing status will not change," he said.

There are about 130,000 same-sex married couples in the United States, according to estimates from the Census Bureau.

A separate Supreme Court ruling in June made California the 13th of the 50 U.S. states to recognize gay marriage. The District of Columbia also recognizes gay marriage.