The country's administrative court ordered the ministries of communication and investment to block YouTube, owned by Google , inside Egypt because it had carried the film "Innocence of Muslims", said state news agency MENA.
The 13-minute video, billed as a film trailer and made in the United States, provoked a torrent of anti-American unrest in Egypt, Libya and dozens of other Muslim countries in September.
The video depicts the Prophet as a fool and a sexual deviant. For most Muslims, any portrayal of the Prophet is considered blasphemous.
The court said it was ruling on a case brought about the film several months ago, without going into further detail.
YouTube had "insisted on broadcasting the film insulting Islam and the Prophet, disrespecting the beliefs of millions of Egyptians and disregarding the anger of all Muslims" the court said, according to MENA.
Egypt's National Telecommunication Regulatory Authority said it would abide by the ruling as soon as it received a copy of the verdict.
No one was immediately available for comment from Google or YouTube.