A teenage blogger from Singapore who was jailed for posting criticisms of his government online has been granted asylum in the United States.

Amos Yee, 18, has been detained by US immigration authorities since December when he was taken into custody at Chicago's O'Hare airport.

Attorneys said he could be released from a Wisconsin detention centre as early as Monday.

Judge Samuel Cole issued a 13-page decision on Friday, more than two weeks after Yee's closed-door hearing on the asylum application.

"Yee has met his burden of showing that he suffered past persecution on account of his political opinion and has a well-founded fear of future persecution in Singapore," Cole wrote.

Yee left Singapore with the intention of seeking asylum in the U.S. after being jailed for several weeks in 2015 and 2016.

The teenager, who is an atheist, was accused of hurting the religious feelings of Muslims and Christians in Singapore.

In 2015 he created controversy when he posted an expletive-laden video about Prime Minister Lee Kuan Yew just after his death.

The case raised questions about free speech and censorship in Singapore and has been closely watched abroad.

Judge Cole said testimony during Yee's hearing showed that while the Singapore government's stated reason for punishing him involved religion, "its real purpose was to stifle Yee's political speech."

Department of Homeland Security attorneys had opposed the asylum bid, saying Yee's case didn't qualify as persecution based on political beliefs.

Opposition politician Kenneth Jeyareretnam who gave testimony supporting Yee's asylum said "this is a major embarrassment for the government, that all along claimed Amos' persecution was not political"

Jeyaretnam said the decision "may create waves in Singapore. It may show Singaporeans that there's nothing to be afraid about".

He added: "We don't have to swallow the brainwashing that is constantly put out."

Yee's attorney Sandra Grossman said her client was elated.

"He's very excited to begin new life in the United States," Grossman said.

Yee told reporters in a phone interview from jail this month that he feared returning to Singapore.

But he said he would continue to speak out and had already planned a line of T-shirts and started writing a book about his experiences.