HONG KONG — A teenage blogger who was convicted of two charges after criticizing Lee Kuan Yew, the founding father of modern Singapore, was released on Monday after a court sentenced him to four weeks’ detention, which he had already served.

The blogger, Amos Yee, 16, brought international attention to Singapore’s tight restrictions on speech after he posted an eight-minute video celebrating Mr. Lee’s death in March. He was convicted of hurting religious feelings for comparing Mr. Lee’s supporters unfavorably to Christians, and of obscenity for posting an image that depicted Mr. Lee and Margaret Thatcher, the former British prime minister, engaged in a sex act.

A judge ordered in June that Mr. Yee undergo a psychiatric examination after a doctor’s report suggested he could have autism spectrum disorder. He faced the possibility of mandatory psychological treatment, but the examination concluded that he had no mental disorder.

Prosecutors dropped their call for reformative training, a form of discipline for juveniles similar to detention that could last at least 18 months, after Mr. Yee agreed in writing to remove the video and the image. He also agreed not to post them again.