At least two people have been killed and seven others wounded after a bomb planted on a motorcycle exploded outside a mosque in Pakistan's largest city Karachi, police have said.

The blast took place in the congested Aram Bagh area, outside a mosque belonging to a sub-sect of the minority Shia Muslim community after Friday prayers.

Pakistan has been hit by a rising wave of sectarian violence in recent years, most of it carried out by armed groups targeting Shias.

Saif-ud-Din, a witness, said people were coming out of the mosque after prayers when there was a huge blast and many people fell to the ground.

"I was inside the mosque when the bomb exploded and I saw people falling to the ground," Din told the AFP news agency.

Umer Khatab, a senior officer at the police Counter Terrorism Department, told reporters that about two kilogrammes of explosives were used in the bomb, which was detonated with a timer.

Many worshippers in bloodstained clothes gathered outside the mosque, searching for relatives.

The blast ripped through the shutters of several nearby shops and shattered windows.

North Nazimabad attack

In a separate incident, a suicide bomber on Friday evening rode a motorbike into a vehicle carrying paramilitary rangers in the east of the city killing two officers.

"A suicide bomber riding on a motorbike hit the mobile van of rangers in the neighbourhood of North Nazimabad killing two soldiers," senior police official Faisal Noor told AFP.

He said three other soldiers in the vehicle were injured and one was in critical condition.

In January, 61 people were killed in a suicide bombing carried out by a Taliban splinter group at a Shia mosque, the deadliest sectarian incident to hit the country since 2013.

Karachi, a city of 18 million, is rife with criminal, ethnic, political and sectarian killings, which claim hundreds of lives each year.

Source: Agencies