By Zia ur-Rehman and Salman Masood

KARACHI, Pakistan — One of the most prominent Pakistani singers of Sufi devotional songs, Amjad Sabri, was killed by gunmen who fired into his car in Karachi on Wednesday, raising a new outcry over sectarian and extremist violence in Pakistan.

A faction of the Pakistani Taliban claimed responsibility, accusing Mr. Sabri of being a blasphemer, but officials said they were investigating the authenticity of the claim.

Two attackers riding a motorcycle intercepted Mr. Sabri’s vehicle in the busy Liaquatabad neighborhood of Karachi and sprayed it with bullets, then escaped. Mr. Sabri was headed to the studios of a private television news network to record a show related to Ramadan, the holy Muslim month, officials said, and he died on the way to Abbasi Shaheed Hospital. At least one other person in the car, possibly a relative of Mr. Sabri’s, according to some reports, was reported hurt.

“It was a targeted attack,” said Muqaddas Haider, a senior police officer in Karachi’s Central District, who noted that Mr. Sabri had been hit by three bullets. “We are investigating who could be behind the killing.”

Mr. Sabri, 45, was one of the foremost singers of qawwali music — the devotional songs of Sufism, a mystical branch of Islam — and was part of a family of noted performers. In 2014, Mr. Sabri was embroiled in controversy after a morning news program played his version of a traditional qawwali song that referred to the Prophet Muhammad. A blasphemy case was registered against the show hosts and the television network, Geo, and Mr. Sabri was named in the complaint.

Mr. Sabri’s death sent shock waves throughout the country on Wednesday as condemnation poured in and people expressed anger over the killing of a beloved singer.

“For so many in Pakistan, Amjad Sabri was an iconic cultural ambassador of Pakistan just like his ancestors were for our previous generations,” said Shezreh Mirza, a prominent legal consultant. “I am at an utter loss to understand this senseless killing of a legend at the prime of his life. Pakistan’s soul stands tormented yet again today.”

As violent sectarian groups have continued to attack religious minorities and other groups in Pakistan with seeming impunity, revered Sufi shrines and gatherings have been targeted in recent years, despite a respected tradition of Sufi tolerance and art. In 2010, the shrine for the Sufi saint Abdullah Shah Ghazi came under attack in Karachi, and the same year, one of the most important and largest shrines in the eastern city of Lahore was targeted in a bombing that left 42 people dead. Sufi shrines and mosques have been repeatedly targeted in the country’s northwest.

Blasphemy has been another red line for extremist violence, with mere accusations of blasphemous speech frequently leading to vigilante attacks, even if the case had not been taken up in court under Pakistan’s widely criticized blasphemy laws.

The killing of Mr. Sabri has also put the spotlight back on violence in Karachi, where, just on Monday, unidentified gunmen kidnapped the son of the Sindh High Court’s chief justice. Karachi, the country’s biggest city and commercial hub, has also long been known for extremist and political violence.

The Sindh Rangers, a provincial paramilitary force under the direction of the Pakistani military, has been conducting a campaign against armed political groups and militants in the city. But the Muttahida Qaumi Movement, a political party that has traditionally controlled the city, has accused the Rangers of extrajudicial killings and intimidation. Rangers and rights activists say the party has used violence and political assassinations to control the port city in the past few decades.

Soon after Mr. Sabri’s killing, Farooq Sattar, a senior party leader, questioned the effectiveness of the Rangers’ presence and said Mr. Sabri had expressed security concerns to him. But Mr. Sattar stopped short of naming who he thought was behind the killing, using the vague term “extremist elements.”

Another party leader, Mustafa Azizabadi, said on Twitter that Mr. Sabri was being pressured to join a new political party, Pak Sar Zameen, that was formed by breakaway Muttahida Qaumi Movement leaders and is believed to have the backing of the country’s powerful military establishment. He said Mr. Sabri’s refusal to join had led to threats.

The Muttahida Qaumi Movement has announced a three-day mourning for Mr. Sabri in Karachi.

Outside Mr. Sabri’s house in Liaquatabad, residents congregated to offer condolences to the singer’s family. Shopping areas and businesses were shut down in the neighborhood.

“I cannot believe it,” Aashiq Hussain, a student at the University of Karachi, said, standing outside Mr. Sabri’s residence. “Yesterday night, I listened his song live on a TV channel.”

Zia ur-Rehman reported from Karachi, and Salman Masood from Islamabad, Pakistan.