(Reuters) - In a victory for supporters of gay rights, public employers in Michigan can offer benefits such as health coverage to same-sex domestic partners after a federal judge ruled Friday that a state law banning the practice is unconstitutional.

U.S. District Court Judge David Lawson found that a Michigan law clearly deprived same-sex couples of benefits in violation of equal protection rights in the U.S. Constitution, and he blocked the law.

The ruling, which cited in part the U.S. Supreme Court's ruling on Wednesday that struck down a key part of the Defense of Marriage Act, does not automatically expand coverage for Michigan's same-sex couples, but allows public employers such as counties, cities or school districts to choose to do so.

Michigan's Constitution has barred same-sex couples from marrying since 2004, but some public employers had extended benefits to same-sex domestic partners since then, including the Michigan Civil Service Commission.

Several state lawmakers objected to extending the benefits and introduced a bill in June 2011 that was approved and then took effect in December 2011, leading to the court challenge by five same-sex couples whose benefits were put in jeopardy.

Lawson found that the legislative history of the law demonstrated that it was a "concerted attempt" to block same-sex partners from benefits.

"Looking to the history and text ... it is hard to argue with a straight face that the primary purpose - indeed, perhaps the sole purpose - of the statute is other than to deny health benefits to the same-sex partners of public employees," Lawson wrote in his 51-page opinion.

The five couples who sued over the law are in long-term relationships and would marry if allowed to in Michigan. Each had a partner working for a public employer that extended fringe benefits to domestic partners that would be lost when union contracts expired.

"This law was clearly meant to target families like ours and to make us feel as though we didn't count," Peter Ways, a teacher whose partner would have lost benefits under the law, said in a statement.

Michigan argued the law did not intend to discriminate based on sexual orientation and was aimed at saving money by restricting the scope of public employee benefits.

"Aside from saying so, the defendant has offered little to support its cost-savings rationale," Lawson wrote, adding that the law did not use the words sexual orientation, but "renders access to benefits legally impossible only for gay and lesbian couples."

Friday's ruling did not consider whether Michigan's ban on gay marriage is constitutional, the subject of a separate challenge before the federal court in Detroit.

(Reporting by David Bailey in Minneapolis; Editing by Greg McCune and Bernard Orr)

["Gay Couple Pouring Champagne To Toast At Their Wedding. The Groom On The Right Is Covered With Champagne From The Splash When The Cork Popped" via Shutterstock]