KARACHI, Pakistan (AP) — An Islamic State suicide bomber targeted worshippers at a famous shrine in southern Pakistan on Thursday, killing at least 39 people and wounding over 100 others, officials said, in one of the deadliest attacks the country has seen in recent months.

According to three security officials, the suicide bomber entered the main hall of the shrine of Lal Shahbaz Qalandar in Sehwan in the southern Sindh province and detonated his explosives amid a gathering that included men, women and children. The officials spoke on condition of anonymity as they were not authorized to speak to media.

The Islamic State group claimed responsibility for the attack on their Aamaq news agency, saying a suicide bomber had targeted a "Shiite gathering" at the shrine.

Rizwan Edhi, the spokesman for Pakistan's largest private ambulance service, Edhi, said they had transported more than 45 bodies to hospitals thus far and that the death toll would likely rise as some of the wounded were listed as being in critical condition.

Munawar Maiser, a deputy commissioner in the Sindh province said at least 50 people were killed and 150 wounded in the attack. A health official in Sindh, Fazal Pejo, said the death toll had risen to over 70 people.

A witness, Raja Somro, who was inside the shrine at the time of the attack, told a local TV network that hundreds of people were performing their spiritual dance — called Dhamal — when the attacker struck at the shrine of Lal Shahbaz Qalandar, named after the famous Sufi saint buried there

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

Local TV channels aired footage of worshippers crying for the help after the blast.

State-run Pakistan Television quoted Prime Minister Nawaz Sharif as saying that the country's military and other security forces would use all their resources to track down and arrest the culprits.

In a strongly-worded statement, Pakistan's army chief Gen. Qamar Javed Bajwa said "each drop of nation's blood shall be revenged, and revenged immediately. No more restraint for anyone."

The army spokesman Maj. Gen. Asif Ghafoor said acts of terrorism were being carried out "from hostile powers and from sanctuaries in Afghanistan." Without providing any further details, he said "we shall defend and respond."

He said Pakistan's armed forces would use their resources to transport the wounded to nearby hospitals and that the air force would also sending a plane to airlift the wounded from Sehwan and other areas.

Muhammad Zubair, the governor of Sindh province, condemned the attack, saying terrorists could not deter the resolve of Pakistani nation by carrying out such attacks. "The whole nation is united and we will defeat the terrorists," he said.

Thursday's attack came a day after two suicide bombings in northwestern Pakistan killed six people following an almost three-month-long lull in the volatile region.

A breakaway Taliban faction claimed responsibility for one of the attacks — a bombing that targeted the area's administrative tribal headquarters in the Mohmand region bordering Afghanistan.

Jamaat-ul-Ahrar, or Freedom Movement, claimed responsibility for the attack in a text message sent to The Associated Press.

Pakistani militants have stepped up attacks in recent weeks. On Monday, a suicide bomber targeted policemen who were escorting a protest march, killing 13, including seven policemen in the eastern city of Lahore.

Jamaat-ul-Ahrar is based in the Mohmand area — part of the rugged, lawless regions along the Afghan border which have long served as safe havens for local and al-Qaida-linked foreign militants.

Pakistan has waged several offensives against militants in recent years, including a major operation that started in mid-2014 in the last key insurgent sanctuary of North Waziristan. Pakistan declared the offensive a success, saying it had uprooted militants, killed hundreds and forced many to flee across the border into Afghanistan.