After months of waiting, a Yemeni mother has been granted permission by the State Department to fly to California to say goodbye to her dying 2-year-old son, according to her attorney.

The woman, 21-year-old Shaima Swileh, has been living in Egypt but is a citizen of Yemen, one of several Muslim-majority countries targeted under a travel ban imposed by the Trump administration. Swileh’s husband, Ali Hassan, 22, is a U.S. citizen and resident of Stockton, Calif. The two met in Yemen, were married in February 2016 and soon had their son, Abdullah.

But the boy was born with a degenerative brain disorder called hypomyelination, which caused him to experience seizures and other symptoms as an infant, the family’s attorney, civil rights lawyer Saad Sweilem, told The Washington Post on Tuesday. Swileh and Hassan moved to Egypt, where they requested a travel visa for Swileh through the U.S. Embassy in Cairo. The family hoped to get Abdullah medical care in a U.S. hospital.

But in January 2017, President Trump declared the travel ban by executive order, complicating Swileh’s efforts to obtain a visa, her attorney said.

Swileh was called to the embassy for interviews in October 2017 and January 2018, and she sent officials updates on her son’s worsening condition along the way. During the January appointment, officials told her that she would not be granted a travel visa and instead needed to apply for a travel ban waiver, her attorney said.

Adbullah got sicker, and Swileh’s case remained in limbo.

Finally, in August, she was brought to the embassy for a third interview and handed a piece of paper confirming that her eligibility for a waiver was still being reviewed.

“At that point, it was getting really bad,” Sweilem said.

So in October, Swileh’s husband and son boarded a plane to California without her. The boy began seeking treatment at UCSF Benioff Children’s Hospital in Oakland, where doctors sent letters to the embassy in Cairo about Abdullah’s dire health, Sweilem said. Still, there was no progress. Then, last week, the Council on American-Islamic Relations-Sacramento Valley, a legal and advocacy organization, got involved and Sweilem took on the case.

Publicity and pressure over Swileh’s situation mounted over the weekend and culminated Monday in a news conference at the CAIR offices in Sacramento.

“My son, Abdullah, needs his mother. My wife is calling me every day wanting to kiss and hold her son for the last time,” Hassan said, pleading through tears for the U.S. government to reconsider the case. “Time is running out. Please help us get my family together again.”

Rep.-elect Ilhan Omar (D-Minn.), who last month became one of the first Muslim women elected to Congress, issued a strongly worded statement on the case Monday afternoon.

“As a mother and an immigrant from one of the so-called ‘banned’ countries, I am sickened and outraged by the Trump administration’s disregard for a mother separated from her son,” said Omar, a refugee from Somalia. “Instead of extending humanity and compassion to migrants and refugees seeking a better life, we treat them as criminals. We should be welcoming immigrants into our country, not demonizing them.”

Rep. Barbara Lee (D-Calif.) said Monday that she was “working hard” to reunite Swileh with her son.

“As a member of Congress, and a mother myself, the cruelty of barring a mother from reuniting with a sick child takes my breath away,” Lee said on Twitter. “This travel ban is inhumane and un-American.”

Sweilem and co-counsel Jennifer Nimer also filed a writ of mandamus request in district court in Washington, asking for a judge to order the government to expedite Swileh’s waiver application.

But by Tuesday morning, Swileh’s case was resolved.

A State Department spokesman, speaking on the condition of anonymity, declined to address specific questions posed by The Post and instead issued a statement that said only that the department does not discuss the details of individual visa cases.

Sweilem said he was with Hassan when the man got a call from his relieved wife saying the embassy in Cairo had granted her a waiver.

CAIR-Sacramento Valley announced the news on Twitter shortly afterward.

“We’re really grateful. A lot of the community came out yesterday,” Sweilem said. “A lot of people from all across America spoke up and said, ‘This isn’t right; a family shouldn’t be separated.’ ”

Swileh has booked a flight and will arrive in California on Wednesday. And though getting her to the United States is a victory, the occasion is also solemn, her attorney said.

“The last time she was with her son, he was still well,” Sweilem said. “She is going to walk in to see her son on life support.”