Pakistani forces have killed and arrested dozens of terror suspects in sweeping overnight raids after a suicide bombing by the Isis group killed 75 worshippers at a famed Sufi shrine in the country's south.

The terror attack - Pakistan's deadliest in years - stunned the nation and raised questions about the authorities' ability to rein in militant groups despite several military offensives targeting militant hideouts.

The raids targeted militant hideouts and led to shoot-outs with insurgents which left at least 39 militants dead across Pakistan, according to three security officials.

Most of the operations were carried out by the paramilitary Rangers.

In one raid, the troops killed 11 suspects at a militant hideout in the port city of Karachi. In another, the Rangers came under fire as they were returning from Sehwan, a town in southern Sindh province where the shrine bombing took place, and killed seven of the attackers.

Other raids took place in north-western Pakistan and also in the eastern province of Punjab. The officials said a total of 47 suspects were arrested in the raids.

In Thursday's attack, a suicide bomber walked into the main hall at the Lal Shahbaz Qalandar shrine in Sehwan, and detonated his explosives among a crowd of worshippers, killing 75. At least 20 women and nine children were among the dead and dozens of other people were injured in the explosion.

IS claimed the attack in a statement circulated by its Aamaq news agency, saying it had targeted a “Shiite gathering”.

The Sunni extremist group views Shiites as apostates and has targeted Pakistan's Shiite minority in the past. It views Sufi shrines like the one targeted on Thursday as a form of idolatry.

Raja Somro, who witnessed the attack, told a local TV network that hundreds of people were performing a spiritual dance known as the “dhamal” when the bomber struck.

“I saw bodies everywhere. I saw bodies of women and children,” he said.

Local TV showed graphic footage of the aftermath of the blast, with wounded worshippers crying out for help and the floors covered with shoes, blood and body parts. Women cried and beat their chests in grief.

A man mourns the death of a relative killed in the suicide blast (Akhtar Soomro/Reuters)

Prime Minister Nawaz Sharif vowed that security forces would track down the perpetrators of the attack, according to Pakistani state TV.

“Each drop of the nation's blood shall be avenged, and avenged immediately,” Pakistan's army chief, General Qamar Javed Bajwa, said in a statement. “No more restraint for anyone.”

The US State Department condemned the attack and offered its support to Pakistan in bringing the perpetrators to justice.

Thursday's attack was the deadliest in Pakistan following an assault on an army-run school in Peshawar on December 16 2014 that killed 154 people, mostly schoolchildren.

Pakistan has been at war with the Taliban and other extremist groups for more than a decade. In recent years it has launched major offensives against militant strongholds in the tribal regions along the border with Afghanistan, but insurgents have continued to carry out attacks elsewhere in the country.

IS has been expanding its presence in Pakistan in recent years and has claimed a number of deadly attacks, including a suicide bombing at another Sufi shrine in November 2016 in which more than 50 people were killed. A Taliban-linked group, Jamaat-ul-Ahrar, claimed responsibility for that attack.

The government has played down the Isis affiliate, insisting that only a small number of militants have pledged allegiance to the group.

Afghanistan and Pakistan have long accused each other of failing to crack down on militants who operate along the porous border. Shortly after Thursday's attack, Pakistan closed the main Torkham border crossing with Afghanistan.

On Friday, Pakistan's military handed over to Kabul a list of 76 suspected “terrorists” allegedly hiding in Afghanistan, demanding they be captured and extradited to Islamabad.

A statement said the list was given to Afghan officials at the Pakistani army's sprawling headquarters in the garrison city of Rawalpindi.

The military did not specify who was on the list, but it has long claimed that the head of Pakistani Taliban, Mullah Fazlullah, and other militants are hiding on Afghan soil with the purpose of fomenting violence inside Pakistan.

In pictures: Pakistan hospital attack Show all 10 1 /10 In pictures: Pakistan hospital attack In pictures: Pakistan hospital attack A man reacts after his relative was killed in a bomb blast in restive Quetta EPA In pictures: Pakistan hospital attack Residents light candles to honour victims of the blast in Quetta during a candellight vigil in Peshawar Reuters In pictures: Pakistan hospital attack People carry the coffin of a victim of suicide bomb attack at a hospital for burial in Quetta REUTERS In pictures: Pakistan hospital attack Pakistani victims injured in a suicide bombing are treated at a hospital in Quetta AFP/Getty Images In pictures: Pakistan hospital attack A lawyer who was injured in a bomb blast wait to receive medical treatment in restive Quetta EPA In pictures: Pakistan hospital attack A doctor treats an injured lawyer at the scene of a bomb blast in restive Quetta EPA In pictures: Pakistan hospital attack People comfort a man mourning the death of a family member who was killed in suicide bombing, at a funeral in Quetta AP In pictures: Pakistan hospital attack People transfer an injured man from the blast site in Quetta Rex Features In pictures: Pakistan hospital attack Pakistani security officials and lawyers gather around the bodies of victims killed in a bomb explosion at a government hospital premises in Quetta AFP/Getty Images In pictures: Pakistan hospital attack The scene following a bomb blast outside a hospital in Quetta Naseer Ahmed/Reuters

Meanwhile, mourners gathered at the Sehwan shrine for a small rally to demand justice for the victims as some of the funerals got under way.

Relatives consoled the wailing mother of Zeeshan Ali, a 13-year-old who died in the blast and who was buried on Friday.

Zeeshan's uncle, Shoukat Ali, said he was devoted to his nephew and raised him since he had no children of his own.

“I raised him like my own child... and they took him from me,” he said.