Mr. Yee had posted a short video on YouTube titled “Lee Kuan Yew Is Finally Dead!” in which he questioned the late leader’s legacy. He said Mr. Lee and Jesus were “both power hungry and malicious” and criticized their followers, comments that formed the basis of the charge that he had violated a Singapore law against acting with “deliberate intention of wounding the religious or racial feelings.”

The teenager also posted an image on his blog depicting Mr. Lee engaged in a sex act with Margaret Thatcher, the former prime minister of Britain, which led to the obscenity charge.

“His actions show him to be a misguided young man who sought to gain attention for himself by deliberately posting obscene material to shock and deliberately posting material he admits he knew would cause ill will among Christians,” a deputy public prosecutor, Hay Hung Chun, told the court on Tuesday.

“His actions are far from being ‘noble’ or imbued with good intentions,” Mr. Hay said.

Prosecutors told the court a fine or prison time would be inappropriate given Mr. Yee’s age. “What he urgently needs is counseling and appropriate probation,” Mr. Hay said.

Mr. Yee faces a prison term of up to three years on the charge of wounding religious feelings, and up to three months in prison on the obscenity charge. Shortly after his arrest, the teenager was released on bail posted by a supporter, and then returned to custody in Changi Prison after he refused to comply with bail requirements that he not continue posting online.