Relatives comfort a woman who lost a family member in a suicide attack at a mosque in Peshawar. (AP)

A militant attack on a Shiite Muslim mosque in the Pakistani city of Peshawar has killed at least 19 people, officials say.

The attack also wounded more than 40 people, according to provincial information minister Mushtaq Ghani. There was much shooting in the immediate aftermath of the explosion but he said the violence is over.

A senior police officer, Mian Mohammad Saeed, said three or four attackers entered the mosque and one suicide bomber blew himself up.

The Pakistani Taliban has claimed responsibility for the attack.