Image copyright EPA Image caption Dozens of people were wounded in the attack

At least 40 people have been killed in a bomb blast at a Shia mosque in southern Pakistan, officials say.

Dozens were wounded in the attack after Friday prayers in Shikarpur district of Sindh province, and the death toll is expected to rise.

Sunni militants linked to the Pakistani Taliban said they carried out the attack.

Local media reports suggest that the blast could have been a suicide attack, but police are investigating.

There has been rising sectarian violence in Pakistan in recent years. Sunni militant groups have targeted the Shia minority in the past.

The Jundallah militant group claimed that they had carried out the attack. The group has been linked to Tehreek-e-Taliban Pakistan (TTP) and announced allegiance to Islamic State (IS) last year.

A number of people were trapped after the roof of the mosque collapsed due to the force of the explosion, local media said.

Witness Zahid Zoon told AFP news agency that hundreds of people rushed to the scene after the blast to try to dig out survivors from the rubble.

"It is chaos," he said.

Image copyright AFP/Getty Image caption The bomb exploded at a packed mosque just after Friday prayers

Image copyright AFP Image caption Some people were trapped after the roof of the mosque collapsed from the force of the explosion

Senior police official Abdul Qudoos Kalwar said that four children were among the dead, according to the Associated Press news agency

Several of the most severely wounded patients were taken to hospitals in the cities of Larkana and Sukkur.

Analysis: BBC's Ilyas Khan, Islamabad

Jundallah has been part of TTP and has been linked to militant groups including al-Qaeda as well as an Iranian Sunni Muslim group.

If the Jundallah claim is to be trusted, it would be its second most audacious attack on Shia Muslims in recent years. In 2012, it said it killed at least 18 Shia passengers after pulling them out of a bus in the northern Kohistan region.

The group first hit the headlines in 2004 with an ambush on the army's Karachi Corps commander. Though it did not claim the attack, the investigators named it and arrested some of its members.

Police in Karachi have blamed some recent attacks on Jundallah , but the group itself has made no comment.

However, some of its recent claims have conflicted with those of the TTP. In June 2013 it said it carried out the killing of nine foreign climbers on Nanga Parbat, but the TTP said a specially established unit called Jundul Hafsa had done it.

Three months later, both Jundallah and Jundul Hafsa claimed the killing of over 70 Christians in a church in Peshawar, but the TTP later said Jundul Hafsa was not involved.

Dr Shaukat Ali Memon, from the hospital in Shikarpur which received the first of those wounded, made an appeal on state television for blood donations.

Pakistan Prime Minister Nawaz Sharif has condemned the incident and ordered an immediate inquiry.

The attack came as Mr Sharif visited the city of Karachi, the capital of Sindh province.

The BBC's Ilyas Khan in Islamabad says that attacks on Shia targets have been fairly common in Karachi, on the coast, but are relatively new in the interior of Sindh province, where the influence of a more tolerant Sufi Islamic tradition is more widespread.

Our reporter says that Friday's incident is reportedly the fifth attack of a sectarian nature in the province's interior since 2010.