Egypt’s top administrative court ordered authorities to block video-sharing website YouTube for a month over a film denigrating Islam’s prophet Muhammad.

The ruling on Saturday ends a years-long appeals process over the 2012 amateurish film, Innocence of Muslims, which depicts the prophet Muhammad as a buffoon and a paedophile.

It sparked a wave of angry anti-American protests across the Middle East in which more than 30 people were killed.

Protesters riot in central Cairo in 2012 over the film. Photograph: Ed Giles/Getty Images

Washington sought to keep a lid on the demonstrations by saying the controversial film was made privately with no official backing. US officials said freedom of speech laws prevented them from stopping the production of inflammatory material.

A lower court had ordered the video-sharing site be blocked in 2013 after it carried the video, but the case was appealed by Egypt’s National Telecommunications Regulatory Authority and the ruling was stayed.

The top administrative court’s ruling is considered final and cannot be appealed. As of Saturday afternoon, YouTube was still accessible in Cairo.