After three years in exile, YouTube has returned to Pakistan, with a big caveat.

The Google-owned video-sharing site returned to the country on Monday after a Pakistan-specific version was created that allows the government to filter content it considers offensive, Pakistan said Monday. The site was blocked in 2012 after refusing to pull a clip that mocks the prophet Muhammad, a video considered by the government to be blasphemous.

YouTube, along with parent Google, has long had a stormy relationship with a handful of countries over its reluctance to censor material considered offensive or disruptive. In addition to Pakistan, YouTube has also been banned in China, Iran, North Korea and Turkey, among others.

The Ministry of Information Technology and Telecom, the government agency responsible for telecommunications within Pakistan, told Reuters that Pakistan's new version of YouTube will provide the Pakistan Telecommunication Authority with an avenue for blocking material it finds objectionable.

"On the recommendation of PTA, Government of Pakistan has allowed access to recently launched country version of YouTube for Internet users in Pakistan," the ministry said in a statement published by Reuters.

"Google has provided an online web process through which requests for blocking access of the offending material can be made by PTA to Google directly and Google/YouTube will accordingly restrict access to the said offending material for users within Pakistan," the ministry said.

Representatives for Mountain View, California-based YouTube did not respond to a request for comment during the long holiday weekend in the US. The Ministry of Information Technology and Telecom also did not respond to a request for comment.

The video was deemed blasphemous, an act legally prohibited by Pakistan law. Penalties for violating the law range from fines to death. While no one has been executed by court order, angry mobs have been blamed for dozens of murders of those accused of blasphemy.