KARACHI, Pakistan — A liberal Muslim scholar who had been accused of blasphemy for a speech he gave during a visit to the United States was shot and killed in Karachi on Thursday, the city police said.

The scholar, Muhammad Shakil Auj, was the dean of Islamic studies at the state-run University of Karachi.

Unidentified gunmen on a motorbike attacked the vehicle he was riding in on his way to a reception at his honor at the Iranian Consulate.

Dr. Auj was shot in the head and neck and died immediately, officials said. A female student in the back of the car was shot in the arm and was treated at a hospital.