A mother from Yemen has been granted her wish to see her dying toddler one last time, after the United States agreed to issue her a waiver from its ban on citizens from several Muslim-majority countries.

Two-year-old Abdullah Hassan, a US citizen like his father, suffers from a rare genetic brain condition and is on life support in a hospital in Oakland, California.

But his mother, Shaima Swileh, had been unable to join him due to US President Donald Trump's order barring visitors from six countries, including Yemen.

After a tearful televised plea from the boy's father prompted public outrage, the US Embassy in Cairo issued a visa for Ms Swileh, who has been living temporarily in Egypt.

She will arrive in San Francisco later today, according to the Council on American-Islamic Relations, the Muslim civil rights group that assisted the family.

"This is the happiest day of my life," her husband, Ali Hassan, said in a statement. "This will allow us to mourn with dignity."

Mr Hassan said he had been ready to take his son off life support last week after doctors said the case was terminal, with his wife only receiving automated replies when inquiring with US authorities on her visa application.

The Council on American-Islamic Relations began a campaign that it said prompted 15,000 emails to elected officials, as well as thousands of tweets.

Abdullah's grandfather earlier told the San Francisco Chronicle that Ms Swileh was crying every day as she wanted to see her son "one last time".

"To hold him for at least a minute. She's not going to see him forever," he said.

Representative Barbara Lee, a Democrat who represents Oakland and took up Ms Swileh's case, had described denying the mother a visa as a level of cruelty that "takes my breath away".

She voiced relief at the waiver but added: "So many families are still torn apart by the heinous travel ban."

"We can't stop until we end this un-American policy for good," she wrote on Twitter.

State Department spokesman Robert Palladino voiced sympathy for the family in the "very sad case". But he said that visas are "decided on a case-by-case basis" in accordance with US laws.

The US State Department is "ensuring the integrity and security of our country's borders and at the same time making every effort to facilitate legitimate travel to the United States," he told reporters.