Same-sex married couples will be allowed to file joint federal tax returns, the same as married heterosexual couples, the Treasury Department and Internal Revenue Service announced Thursday.

The new policy, a response to a Supreme Court ruling in June that overturned a key provision in the Defense of Marriage Act, allows same-sex married couples to claim marriage-related exemptions, credits and deductions even if they live in jurisdictions that don’t recognize gay unions. Like heterosexual spouses, gay couples will be required to declare “married filing jointly” or “married filing separately.”

Treasury Secretary Jack Lew said in a statement that the move “assures legally married same-sex couples that they can move freely throughout the country knowing that their federal filing status will not change.”

The policy applies only to legally married couples and not to those in registered domestic partnerships, civil unions or similar formal relationships recognized by certain states.

The policy shift was inevitable after the DOMA ruling in United States v. Windsor, but the change nonetheless represents a milestone for gay-rights advocates.

Same-sex marriage status in the U.S., state-by-state

Same-sex couples expressed relief Thursday.

“We’re just so overjoyed about not having to experience that negative feeling of not being a legitimate family,” said Geraldine Artis, who lives in Connecticut with her wife and two teenage children. “We’re looking forward to the experience of filing our taxes jointly and being treated as a family.”

Edith Windsor, the plaintiff in the DOMA case, said in a statement, “Thanks to today’s ruling at the Treasury Department, no one will have to experience the pain and indignity that I went through ever again. I feel so proud and grateful to my country and to our president.”

Windsor was blocked from claiming a spousal exemption to the federal estate tax when her wife, Thea Spyer, died.

Same-sex couples married before the court ruling will have the option of filing amended returns for up to three prior years, according to the announcement. That rule would benefit couples that stand to collect a refund by filing with married status.

“Filing jointly with a spouse most of the time has a benefit, but it could be a penalty for high-income earners,” said Adam S. Fayne, a tax lawyer and former special assistant U.S. attorney with the Treasury Department. “For most people, it’s going to be a benefit and generate a refund.”

The Supreme Court declared in June that the federal government must provide legally married gay couples with the same federal tax, health, Social Security and other benefits that opposite-sex couples receive.

Other federal agencies have already announced that they will allow federal benefits for same-sex spouses of federal workers and military personnel. But those policies affect only a subset of the gay population, whereas Thursday’s announcement impacts all same-sex couples paying taxes in the United States.

“The IRS is an agency that people tend to interact with more than other federal agencies, so it’s going to make a big difference in the lives of same-sex married couples,” said Brian Moulton, legal director for the Human Rights Campaign.

Roberta Kaplan, Windsor’s attorney, said the decision will “put more pressure on states like New Jersey that do not treat their gay citizens equally since it will become increasingly intolerable for those states to continue to treat married gay couples as second-class citizens, especially given that the IRS will now afford them equal respect and dignity under the law.”

Same-sex marriage opponent Bryan Fischer, director of the issues analysis for the American Family Association, predicted the same outcome, adding that the possibility concerns him.

“There will be enormous federal pressure now on states to conform to the IRS,” he said.

“The Supreme Court decision placed an [improvised explosive device] under every state marriage amendment in the land,” he said. “I predict we will very quickly see legal action in the 37 states that do not give legal recognition to same-sex marriage to force them to conform to federal policy on their tax forms, and you will get activist federal judges that will comply.”

Sen. Benjamin L. Cardin (D-Md.), who had called on the IRS last week to clarify its rules on same-sex married couples, expressed support for the rule change.

“I commend the IRS on their decision to treat married same-sex couples as such for federal tax purposes. The Service’s decision follows logically from the Supreme Court’s Windsor decision, and brings greatly-needed guidance and clarity to same-sex couples and their families,” he said in a statement.

The joint Treasury-IRS announcement came hours after the Department of Health and Human Services issued a memo clarifying that gays enrolled in private Medicare plans are entitled to care in the nursing facilities where their same-sex spouses reside. That policy was already in effect for heterosexual couples.