Controversial Singaporean blogger Amos Yee has been granted political asylum by an immigration court in the United States.

Yee, 18, was first convicted of wounding religious feelings in 2015, then convicted of the same offense in 2016 after the court found that he had insulted Islam and Christianity in various blog and Facebook posts.

He was detained by Customs and Border Protection (CBP) at the Chicago O'Hare International Airport on Dec. 16, after traveling to the U.S. from Singapore to seek asylum. After a hearing in March, the judge has concluded Yee's was persecuted by the Singaporean authorities because of his political opinion.

“His prosecution, detention and general maltreatment at the hands of the Singapore authorities constitute persecution on account of Yee’s political opinions,” Immigration Judge Samuel B. Cole says.

Yee, who has been detained in the U.S. since December, is now immediately eligible for release, according to a statement from Yee’s lawyer,

The U.S. Department of Homeland Security has 30 days to appeal the decision.

Read more: INTERVIEW: Meet the New Amos Yee

Past ‘crimes’

Yee, as the BBC described in 2015, is “the enfant terrible who has fascinated and infuriated Singaporeans ever since he was arrested in March [2015] over a YouTube video.” That video, which is titled, “Lee Kuan Yew Is Finally Dead,” openly criticized the legacy of Singapore’s founding father and longtime leader.

The teenager went on to spend 55 days in prison in 2015, after being found guilty of wounding religious feelings and posting a video and an obscene image online. The doctored image depicted Lee Kuan Yew, who is still revered by many, and former British leader Margaret Thatcher in a sex act. He was jailed for three weeks in 2016 after posting more controversial material related to the beliefs of Christians and Muslims in videos, blogs and Facebook posts.

Grossman Law, which acted for Yee in the U.S. pro bono, says the U.S. Department of Homeland Security “actively opposed” Yee's asylum bid, arguing the Singapore government had legitimately prosecuted Yee under laws of general applicability.

However, Judge Cole stated it was “clear” the Singapore government’s prosecution of Yee for wounding religious feelings and obscenity was "just a pretext to silence his political opinions critical of the Singaporean government.”

“His prosecution, detention and general maltreatment at the hands of the Singapore authorities constitute persecution on account of Yee’s political opinions,” the judge says.

In his 13-page judgment, Judge Cole outlines that Singapore is a democracy but it is essentially controlled by one party, the People’s Action Party (PAP). He notes that severe restrictions on freedom of speech instituted under Singapore’s founding father and former Prime Minister Lee Kuan Yew have continued, and in some cases increased, under the rule of his son, current Prime Minister Lee Hsien Loong. He points to the 2006 arrests and investigations of social media bloggers Roy Ngerng and Teo Soh Lung as examples.

Judge Cole says that for persecution to qualify an applicant for asylum, it must be on account of race, religion, nationality, membership in a particular social group, or political opinion.

Singapore’s prosecution of Yee for wounding religious feelings “was pretextual, as its real purpose was to stifle Yee’s political speech," he says.

In response to the Department of Homeland Security’s argument, Judge Cole says, “Though Yee’s prosecutions may have been legal under Singapore law, they clearly served a ‘nefarious purpose,’ namely to stifle political dissent.”

The judge also says that Yee’s fear of future prosecution in Singapore was “well founded.”

Yee’s lawyer commented that while the decision is a success, “it is startling to consider that Yee, a refugee, was detained longer in the United States than in the country that persecuted him. Grossman Law strongly decries the use of prolonged detention of asylum seekers as contrary to internationally accepted principles of human rights.”

His lawyer has said previously that if the asylum claim succeeds, Yee would likely to be able to obtain residency in the United States within a year.

Editor: Olivia Yang