SAN FRANCISCO — Just over a year ago, Maria Mendoza-Sanchez and her husband, Eusebio, stood inside the international terminal at San Francisco International airport holding one-way tickets to Mexico. Through tears and long hugs, they said goodbye to their four children. Immigration authorities had sealed their fate: after more than two decades in the United States, the undocumented couple would be deported back to their home country, barred from returning for at least a decade.

But on Saturday, Mendoza-Sanchez, an Oakland oncology nurse, made a lucky if not miraculous return, allowed to legally stay in the U.S. under an H-1B visa. It was the culmination of a long, complex journey that has catapulted the family into the national spotlight and into the thick of a contentious immigration debate.

“This is really a dream I never expected was going to come true this quickly,” Mendoza-Sanchez said during a press conference Saturday evening after her arrival. She and her children reunited privately before addressing the media at the airport.

Dressed in a navy blue dress and a black blazer, her normally curly hair straightened, Mendoza-Sanchez clutched two bouquets of flowers as her four children surrounded her. Melin, one of her daughters, held a handmade poster that said, “We love you mom.”

Mendoza-Sanchez and her husband Eusebio became the focal point of a national immigration debate last year when they were deported amid the Trump administration’s crackdown on illegal immigration. The undocumented couple — banned from returning for 10 years — had steady jobs, no criminal records and three children who had been born in the U.S.

Mendoza-Sanchez had to abandon her job as a registered nurse at Highland Hospital in Oakland, where she cared for patients with cancer, heart problems and kidney disease for two years under a work visa. But she was dealt a lucky hand this summer when her petition for a visa was one of an estimated 85,000 selected in an H-1B lottery.

Under the H-1B program, American companies can hire skilled foreign workers in specialty occupations, such as IT, finance, architecture, engineering and medicine, where there may be a shortage of suitably trained domestic employees.

Highland Hospital submitted the visa petition on Mendoza-Sanchez’s behalf earlier this year. The petition requires evidence that proves the position is high-skilled.

The H-1B, intended for jobs requiring specialized knowledge and a bachelor’s degree or higher, has become a flashpoint in America’s immigration debate, with tech companies pushing for an expansion of the annual 85,000 cap on new visas, and critics charging that U.S. firms use it to supplant American workers with cheaper, foreign labor.

“Maria has been widely praised by her patients and staff for her work in our oncology unit,” said Terry Lightfoot, spokesman for Alameda Health System, which oversees Highland Hospital. “She has demonstrated fantastic empathy for her patients and her patients have been her primary focus, even while she was going through her deportation.”

Lightfoot said Mendoza-Sanchez is expected to meet with hospital staff this week to discuss her start date.

Maria and Eusebio tried for years to obtain green cards to stay in the U.S. legally, but their requests were denied by immigration judges, then overturned through appeals. The couple’s luck finally ran out in May 2017 when an immigration officer gave them 90 days to exit the country. By August, they were on a flight to Mexico City, despite national outrage over their deportation.

“There were many nights I couldn’t sleep,” said Mendoza-Sanchez. “There were many days I was ready to give up.”

The couple left behind their three oldest children in the U.S.: Vianney, 24, Melin, 22 and Elizabeth, 17. Though they originally took their youngest son, Jesus, 13, with them to Mexico, he eventually joined his sisters back in Oakland.

In her parents’ absence, Vianney took over as the head of household. Because she’s a DACA recipient — brought to the U.S. illegally with her parents as a child — she was unable to visit her mom in Mexico. She was the first to hug her mom Saturday.

“This is the best Christmas present we’ve ever gotten,” she said. “We don’t need anything else.”

Mendoza-Sanchez recalls making plans to move to Canada when she asked her attorney, Camiel Becker, for one last chance.

“I asked him if there were any options for someone like me,” she said. “I hadn’t done anything wrong, I hadn’t broken the law in a way that merited this punishment. It seemed unjust to me. I told him, there has to be something.”

Because Mendoza-Sanchez has several strikes against her — illegally crossing the border with a child, living in the U.S. illegally for more than two decades, and a deportation order — her H-1B visa application would normally have been automatically denied, Becker said.

But a little-known waiver for applicants of specialized visas like the H-1B cleared those strikes and made it possible for her to return, Becker said. The waiver was recommended for approval by the U.S. State Department last month, and U.S. Citizenship and Immigration Services made its final decision shortly after, allowing Mendoza-Sanchez to return to the U.S.

Sanchez will have to wait out the 10-year ban imposed on her before qualifying for any type of legal status, Becker said. The hospital hopes to extend her H-1B protection until then. After the ban is met, Mendoza-Sanchez can petition for legal status through any of her American-born children, though Becker said that complications may arise.

“The war isn’t over,” said Becker.

Mendoza-Sanchez will have to renew her H-1B visa in three years.