A Yemeni mother on Tuesday won her fight for a waiver from the Trump administration’s travel ban that would allow her to go to California to see her dying 2-year-old son.

Shaima Swileh planned to fly to San Francisco on Wednesday after the U.S. State Department granted her a visa, said Basim Elkarra of the Council on American-Islamic Relations in Sacramento, whose lawyers sued this week.

The boy’s father, Ali Hassan, is a U.S. citizen who brought their son, Abdullah, to California in the fall to get treatment for a genetic brain disorder after the boy’s health worsened.

Swileh and the boy had been living in Egypt, and she had hoped to accompany them but was not given a visa to enter the United States. Citizens from Yemen and four other mostly Muslim countries, along with North Korea and Venezuela, are restricted from coming to the United States under the travel ban enacted under President Donald Trump.

As Swileh and her husband fought for a waiver, their son’s health declined. Last week, doctors at UCSF Benioff Children’s Hospital in Oakland put him on life support.

“I am emailing them, crying, and telling them that my son is dying,” Hassan said in an interview with The Sacramento Bee newspaper.

Hassan told reporters he wants his wife to be able to kiss their son one last time.

“This will allow us to mourn with dignity,” he said in a statement provided by the Council on American-Islamic Relations.

Hassan was losing hope of getting her a waiver and was considering pulling his son off life support to end his suffering, but then a hospital social worker reached out to the council, which sued Monday, Elkarra said.

He said Swileh lost months with her child over what amounted to unnecessary delays and red tape.

State Department spokesman Robert Palladino called it “a very sad case, and our thoughts go out to this family at this time, at this trying time.”

He said he could not comment on the family’s situation but that in general cases are handled individually, and U.S. officials try to facilitate legitimate travel to the United States while protecting national security.

“These are not easy questions,” he said. “We’ve got a lot of foreign service officers deployed all over the world that are making these decisions on a daily basis, and they are trying very hard to do the right thing at all times.”

Immigration attorneys estimate tens of thousands of people have been affected by what they call blanket denials of visa applications under Trump’s travel ban, which the U.S. Supreme Court upheld in a 5-4 ruling in June.

The waiver provision allows a case-by-case exemption for people who can show entry to the U.S. is in the national interest, is needed to prevent undue hardship and would not pose a security risk, but many say the government is denying nearly all visa applicants from countries under the travel ban.

A lawsuit filed in San Francisco says the administration is not honoring the waiver provision. The 36 plaintiffs include people who have had waiver applications denied or stalled despite chronic medical conditions, prolonged family separations or significant business interests.

“We hope this case makes the administration realize the waiver process is not working,” Elkarra said. “Thousands of families have been split apart, including families who have loved ones who are ill and are not able to see them in their final hours. I’m sure there are more cases like this.”

In addition to the waiver, the government gave Swileh a visa that will allow her to remain in the United States with her husband and begin a path toward U.S. citizenship, Elkarra said.