WASHINGTON (CNN) — The Obama administration on Thursday formally expressed its support of same-sex marriage in California, setting up a high stakes political and constitutional showdown at the U.S. Supreme Court over a fast-evolving and contentious issue.

In a broadly worded legal brief that senior government sources say had President Barack Obama’s personal input and blessing, the Justice Department asserted gay and lesbian couples in the nation’s largest state have the same “equal protection” right to wed and that voters there were not empowered to ban it.

“Prejudice may not,” said the brief, “be the basis for differential treatment under the law.”

But the administration specifically refused to argue that the constitutional right should be extended to the 41 states that currently define marriage as between one man and one woman.

The justices will hear the so-called Proposition 8 case in March.

That case and another appeal over the federal Defense of Marriage Act will produce blockbuster rulings from the justices in coming months.

“The government seeks to vindicate the defining constitutional ideal of equal treatment under the law,” said Attorney General Eric Holder. “Throughout history, we have seen the unjust consequences of decisions and policies rooted in discrimination.”

“The issues before the Supreme Court in this case and the Defense of Marriage Act case are not just important to the tens of thousands Americans who are being denied equal benefits and rights under our laws, but to our nation as a whole,” Holder added.

Gay rights groups had privately urged Obama and his top aides to go beyond his previous personal rhetoric in support of the right and come down “on the side of history” in this legal fight.

Sources told CNN that Obama made the final decision over whether to file a brief and what to say.

Same-sex marriage could be a defining moment in Obama’s presidency, similar to the political impact last year when the Supreme Court upheld the health care reform law he spearheaded.

He must decide how much political capital to expend in coming months when expressing his views and those of the executive branch.

Obama has already faced strong opposition on the issue from many Republican state and congressional lawmakers, as well as social conservatives.

The justices will hear oral arguments in the Proposition 8 case March 26, with a ruling due by the last week of June.

The separate case over the Defense of Marriage Act involves a 1996 law that says for federal purposes, marriage is defined as only between one man and one woman. That means federal tax, Social Security, pension, and bankruptcy benefits, and family medical leave protections– do not apply to gay and lesbian couples.

That case will be argued March 27.

But it is the Proposition 8 case where the high court is being asked to establish the constitutional “equal protection” right.

The administration is not a party in the California appeal and not required to weigh in, but it decided to file an amicus or “friend of the court” brief.

It is rare for a president to be personally involved in the legal and political considerations in a high court appeal, and sources say he spent a good deal of time reading up on the issue and articulating his views privately.

Much of the legal reasoning in any government brief would reflect in large part his personal thinking, gained from his years as a former constitutional law professor.

There are about approximately 120,000 legally married same-sex couples in the United States.

Dozens of advocacy groups on both sides of the issue have bombarded the high court with briefs, including a coalition of national Republicans, business, faith, and military leaders supporting same-sex marriage.

“As a Republican, I believe in protecting individual freedoms and that everyone, including gay and lesbian Americans, has a constitutional right to be treated equally under the law,” said former Rep. Jim Kolbe.

The president has had an evolving position on gay rights, once supporting only civil unions. But in his inaugural address last month, he raised expectations, and perhaps signaled his impending legal views, when offering sweeping rhetoric.

“Our journey is not complete until our gay brothers and sisters are treated like anyone else under the law– for if we are truly created equal, then surely the love we commit to one another must be equal as well.”

Last November, voters in three states– Maryland, Washington, and Maine– approved same-sex marriage, adding to the six states and the District of Columbia that already have done so.

As more states legalize same-sex marriage, one of the key questions the justices may be forced to address is whether a national consensus now exists supporting the idea of expanding an “equal protection” right of marriage to homosexuals

Many other states, including New Jersey, Illinois, Delaware, Rhode Island and Hawaii, have legalized domestic partnerships and civil unions — a step designed in most cases to provide the same rights of marriage under state law.

But other states have passed laws or state constitutional amendments banning such marriages. California’s 2008 Proposition 8 referendum revoked the right after lawmakers and the state courts previously allowed it.

In February, a federal appeals court in San Francisco ruled the measure unconstitutional. In its split decision, the panel found that Proposition 8 “works a meaningful harm to gays and lesbians” by denying their right to civil marriage.

The justices here have discretion to rule narrowly or broadly on the aspects of the legal and procedural questions raised.