The IRS will now recognize all same-sex marriages for tax purposes, even if the marriages were performed in states that haven't legalized the unions, the U.S. Treasury Department announced Wednesday.

The IRS and the Treasury also said they will "interpret the terms 'husband' and 'wife' to include same-sex spouses" as well as opposite-sex spouses, reported NBC News.

All federal tax provisions in which marriage is a factor will be affected by the new policy, including filing status, claiming personal and dependency exemptions, taking the standard deduction, employee benefits, contributing to an IRA and claiming the earned income tax credit or child tax credit, according to Accounting Today.

The decision marks a reversal of policy that went into effect in 2013 and recognized same-sex marriages only when they were performed in states where the marriages were legal.

The policy change also puts the IRS in line with the U.S. Supreme Court's 5-4 ruling in June that said same-sex couples have a constitutional right to marry.

"The proposed regulations confirm that terms in the federal tax code relating to marriage should be interpreted to include same-sex spouses as well as opposite-sex spouses, ensuring that all are treated equally under the law," said Treasury Secretary Jack Lew in a statement, according to the Associated Press. "These regulations provide additional clarity on how the federal government will treat same-sex couples for tax purposes in light of the Supreme Court's historic decision on same-sex marriage."

Some couples will be able to save money on taxes by filing jointly, while others could face a marriage penalty. The biggest savings often occur when one spouse relies on the other for employer-provided health insurance coverage.

Rep. Sander Levin, D-Mich., the ranking Democrat on the tax-writing House and Ways Means Committee, welcomed the proposal.

"All Americans should be treated equally under the law, and today's announcement by the Treasury Department will help solidify marriage equality in our nation's Tax Code-ensuring all married couples are treated with the respect and fairness they deserve," he said in a statement, reports Accounting Today.

Levin introduced similar legislation in July that would clarify equal treatment for all married couples under the tax code to ensure consistency with the Supreme Court's decision.