(CNN) -- A Hollywood genius might have been hard-pressed to produce a more perfect ending to Melanie Servetas' story.
Servetas was marrying the love of her life Wednesday morning near a picturesque Rio de Janeiro beach. At the same time, the U.S. Supreme Court was striking down the 1996 Defense of Marriage Act, known as DOMA, the sole reason the couple was forced to start their life together thousands of miles away from America.
Joy turned to joy times a million. Everything had changed. Servetas could now come home and, yes, live happily ever after with her wife.
"This is the happiest day of our lives for so many reasons," she said by phone on the taxi ride home from her wedding. "The journey (to come home) is just beginning ... but at least we know we can make the journey now."
Servetas, 48, left a high-powered job and a good life in Rancho Cucamonga, California, after she fell in love with Claudia Amaral, 45, a citizen of Brazil. Even if Servetas had married Amaral in Washington, D.C., or one of 12 states that allow same-sex marriage, she was barred from sponsoring her wife for immigration purposes because of DOMA. The federal law prohibited married same-sex couples from collecting federal marriage benefits.
There are nearly 30,000 such couples, many of whom, like Servetas, were forced to choose between love and country. Wednesday's high court ruling means they no longer have to make that tough decision.
It was an issue that Immigration Equality had worked to resolve for two decades. The organization helped gay and lesbian binational couples seek legal help on immigration. Wednesday, its website said in giant letters: "Yes. You can get a green card," referring to the common term for permanent U.S. residency.
"At long last, we can now tell our families that yes, they are eligible to apply for green cards," said Rachel Tiven, executive director of Immigration Equality.
"Many of our families have waited years, and in some cases decades, for the green card they need to keep their families together. Couples forced into exile will be coming home soon. Americans separated from their spouses are now able to prepare for their reunion. Today's ruling is literally a life-changing one for those who have suffered under DOMA and our discriminatory immigration laws."
Servetas had been anxiously awaiting a Supreme Court decision even as she planned her wedding six weeks ago, after Brazil removed barriers to gay marriage in May.
She picked out a vintage-style cream-colored dress, and Amaral chose Ralph Lauren velvet pants. The two selected lavender accessories.
The ceremony started at 10 a.m. ET at the Botafogo Beach town hall. The justice of the peace ordered an electronic blackout until everything was finished. No Internet, no cell phones.
Servetas and Amaral exchanged rings inscribed with Wednesday's date. They were the first same-sex couple to be married at that location in Brazil, and the paperwork took a while. The suspense was killing them. They couldn't wait to find out the Supreme Court's decision.
When it was over, a clerk called them over and showed them a CNN headline: "DOMA struck down."
"Sorry, I'm babbling on the phone," Servetas said, so excited that she could hardly speak.
To be with Amaral, Servetas gave up her life in the United States and moved to Brazil, where she launched an information technology company. The company is struggling and Servetas misses everything about America.
She lived in limbo, not knowing if one day her work visa in Brazil might not be extended. She went to sleep every night worrying that tomorrow, she may be separated from the woman she loves.
On Wednesday, Servetas took the first steps back to America. She still owns her house in Southern California but says she will go anywhere in the United States that a job takes her. After that, she will sponsor Amaral for a green card -- under U.S. law, her marriage in Brazil will be recognized as legal.
A bill to recognize same-sex partners for immigration purposes was first introduced in Congress in 2000. Since then countless couples have been separated or have had to make the same difficult decision as Servetas and leave home.
Sen. Patrick Leahy, D-Vermont, tried to address the issue in the immigration reform bill with an amendment that included same-sex couples. But the Supreme Court decision on DOMA makes that provision moot.
In Atlanta, Nepal native Satyam Barakoti, 36, on Monday found out the gender of her first baby: a girl. She had already picked out a name for her: Annapurna. But until Wednesday, she was unsure of how she would keep her family together.
She and partner Tonja Holder have been together five years. They bought a house and run a nonprofit consulting agency. But they were forced to discuss the possibility of moving abroad -- to Canada or Thailand.
In February, Barakoti's temporary work visa, known as an H-1B, will expire, and until Wednesday she faced the likelihood of having to leave America. Under DOMA, Holder could not sponsor Barakoti for a green card. Although Barakoti's child will be born a U.S. citizen, children cannot sponsor parents until they are 21.
Uncertainty was king in their lives, disrupting their every move. Not any more.
"We've waited so long for this that I'm still not quite ready to believe it," Holder said. "Everything that was in limbo is actually secure now."
Perhaps she and Barakoti will move to Iowa, which not only allows gay marriage but also ruled recently that both parents in a same-sex marriage be allowed to have their names listed on a child's birth certificate. That would make Holder a legal parent of their daughter.
Holder fights back tears. "It's extraordinary," she said. "I can't believe (the court) supported my family. It's amazing to me."
She cannot imagine what life is going to be like without having to worry about all this. But she can't wait to find out.