The ruling means that legally married same-sex couples should get the same federal benefits as heterosexual couples.
The court invalidated the DOMA provision that prevented married gay couples from receiving a range of tax, health and retirement benefits that are generally available to heterosexual couples.
The vote was 5-4. Justice Anthony Kennedy wrote the majority opinion.
"Under DOMA, same-sex married couples have their lives burdened, by reason of government decree, in visible and public ways," Kennedy said. "DOMA's principal effect is to identify a subset of state-sanctioned marriages and make them unequal."
He was joined by the court's four liberal justices. Chief Justice John Roberts and Justices Samuel Alito, Antonin Scalia and Clarence Thomas dissented.
President Barack Obama hailed the decision to strike down the DOMA provision, declaring the court "has righted a wrong, and our country is better off for it."
Mr. Obama decided in 2011 to stop defending the 1996 law, concluding that it was legally indefensible. In a statement issued while he was flying on Air force One to Africa Wednesday, Obama said he had directed Attorney General Eric Holder to work with others in his administration to make sure federal law reflects the court's decision.
"This was discrimination enshrined in law," he said. "We are a people who declared that we are all created equal - and the love we commit to one another must be equal as well."
On Proposition 8, the Supreme Court ruled the defenders did not have the right to appeal, clearing the way for gay marriage in California.
Same-sex marriage has been adopted by 12 states and the District of Columbia. Another 18,000 couples were married in California during a brief period when same-sex unions were legal.
In the streets of West Hollywood, the news was received with screams of joy from same-sex marriage advicates. Inside the Equality California offices, there were tears.
"We're equal to everybody in California and it's just like, it's awesome," said Martha Acebedo of West Hollywood.
Equality California was one of the many political organizations working to strike down Proposition 8. Members of the lesbian, gay, bi-sexual and transgender community gathered at the group's office to watch the Supreme Court's decision.
For domestic partners Isabella Restrepo and Alicia Guajardo, the news means wedding bells are in the future.
Joel Relampagos and his partner of two years aren't ready to plan a wedding yet, but he's happy that he now has the option.
"Just like everybody else, I was raised to believe in love and marriage. And I think finding out as an adult that love and marriage isn't viewed as equal was disappointing, but I think today's decision really reminds you that everything that you believe in is really worth fighting for," said Relampagos.
The Associated Press contributed to this report.