WASHINGTON — Same-sex military couples will qualify for full benefits, including government-provided health-care and housing allowances, as long as they are legally married, under new rules announced by the Pentagon.

The requirement to be married is a shift for the Pentagon, which in February said full benefits would be provided to members of the military and same-sex spouses if they were in a “committed relationship.”

But Defense Secretary Chuck Hagel said Wednesday that finding a way for unmarried, long-term couples to qualify for benefits “is no longer necessary,” since a Supreme Court ruling in June struck down a federal law that barred married same-sex couples from obtaining federal benefits.

In addition to health-care and housing benefits, the new policy will allow same-sex couples to qualify for extra compensation when a spouse in the military is deployed and unable to live at home. It will also give same-sex spouses access to base facilities, including post exchanges.

Save 75% on a Digital Subscription Today

The benefit payments are retroactive to June 26, the date of the court ruling.