ISLAMABAD, Pakistan — A court on Saturday sentenced to death an elite police guard who assassinated a leading secular politician he had been charged with protecting, a killing that sent shockwaves throughout Pakistan and was seen as a clear marker of growing religious intolerance and extremism in the country.

The news made international headlines not just because of the prominence of the politician who was killed, Salman Taseer, but because the killer was celebrated by many in Pakistan, including lawyers who showered him with rose petals and garlands at a court appearance.

Judge Syed Pervez Ali Shah announced the sentence for the guard, Malik Mumtaz Qadri, in an antiterrorism court at Adiala Jail in Rawalpindi. “Nobody can be given a license to kill on any pretext,” the judge was quoted as saying after the end of the trial.

The ruling was unusual in Pakistan; frightened justices in recent years have been cowed into releasing Islamic militants or letting them off with light sentences. The judgment was especially noteworthy in such a high-profile case against a man whose popularity grew with his confession and defense of the killing on religious grounds.