The blast hit worshippers participating in a ceremony at the shrine of the Sufi saint Shah Noorani, some 750 km south of Quetta, the provincial capital of restive southern Balochistan province.
"At least 52 people have been killed and some 105 others wounded," provincial Home Minister Sarfraz Bugti told AFP, adding that there were women and children among the victims.
Local officials said worshippers were taking part in a devotional dance session, which is held daily before dusk, when the blast occurred.
Authorities said they had dispatched ambulances and medical workers from Karachi, a three-hour drive from the shrine -- which is located in a remote, mountainous region with limited emergency facilities.
The shrine is revered and visited both by minority Shia and Sunni Muslims, but militant groups like the Taliban and ISIS consider the practice against Islam.
ISIS claimed responsibility for the attack via its affiliated news agency Amaq, saying that a suicide bomber targeting the shrine had killed around 35 people and injured 95 others.
But the provincial home minister said it was not immediately clear whether this was a suicide attack.
Hafeez Ali, a 26-year-old mechanic from Karachi, said he was sitting on a hillside and watching the evening's dance to drumbeat when he heard a loud noise and saw smoke rising.
"We realised that it was a bomb blast. Two of us rushed down and saw the bodies scattered all around -- mostly children. We also saw the drum beater dead and his exploded drum was lying nearby," Ali told AFP.
Ali said the shrine sits on a hill which devotees have to climb for half an hour as no road goes there, causing difficulties for rescuers.
Pakistan Army spokesman Lieutenant General Asim said 20 ambulances and 50 soldiers had reached the site, while a further 45 ambulances 100 troops were on their way.
A military helicopter would attempt evacuations at night, he added, but medical teams could not access the area by plane as their were no air strips close by.
Four bodies and 21 of the injured had arrived in Karachi's Civil Hospital, officials said.
President Mamnoon Hussain and Prime Minister Nawaz Sharif strongly condemned the bombing in separate statements.
"The government is determined to eliminate terrorism and extremists from the country," Hussain said in a statement expressing sympathy with the victims and their families.
A statement from Sharif's office said the prime minister called for the "best medical treatment" to be given to the wounded.
Up to 600 people were at the shrine at the time of the attack, according to local official Tariq Mengal, who told Geo TV that many devotees travelled to the site from Karachi during weekends.
The bombing follows the killing of Amjad Sabri, a renowned Sufi singer, by two gunmen in Karachi in June.
Some observers have said that Sabri may have been assassinated because he was a high-profile Sufi.
Sufism, a mystic Islamic order that believes in living saints, worships through music, and is viewed as heretical by some hardline groups including the Taliban.
Balochistan, which borders Iran and Afghanistan, has oil and gas resources but is afflicted by Islamist terrorists, sectarian violence between Sunni and Shiite Muslims and a separatist insurgency.
Local militants claimed to have worked with the ISIS to attack a police academy in Balochistan last month, killing 61 people in the deadliest assault on a security installation in Pakistan's history.
In August, a suicide bombing at a Quetta hospital claimed by ISIS and a faction of the Pakistani Taliban killed 73 people.