With rescuers still pulling bodies from the site in western Turkey, anger swept a country that has seen a decade of rapid economic growth but still suffers from one of the world's worst workplace safety records.
Erdogan expressed his regret after visiting the site in Soma, about 480 km (300 miles) southwest of Istanbul, where around 100 miners are thought to be still trapped underground following Tuesday's fire. "We as a nation of 77 million are experiencing a very great pain," he told a news conference.
But he appeared to turn defensive when asked whether sufficient precautions had been in place. "Explosions like this in these mines happen all the time. It's not like these don't happen elsewhere in the world," he said, reeling off a list of global mining accidents since 1862.
Angry residents broke windows at the local government offices in Soma, some chanting "Erdogan resign", while parts of the crowd lining the street booed as the prime minister walked through the town, jostling with members of his entourage.
Protesters later kicked Erdogan's car as it left the area.
Opponents of Erdogan - who has already faced mass protests against his rule in the past year - have attacked his government for leasing mines to parts of the private sector cozy with the ruling party, and accuse it of ignoring repeated warnings about their safety.
In Istanbul, police fired tear gas and water cannon to disperse several thousand people, some wearing miners' hard hats and headlamps. Police also clashed with demonstrators in the capital Ankara and there were protests in other cities.
Many took to social media to express their outrage at the government's handling of the crisis. "Beyond ridiculous. Turkish PM cites 19th century Britain to prove mining accidents are 'typical'," one user wrote on Twitter.
Fire knocked out power at the mine and shut down ventilation shafts and elevators on Tuesday afternoon. Emergency workers pumped oxygen into the mine to try to keep those trapped alive during a rescue effort that lasted through the night. Thousands of family members and co-workers gathered outside the town's hospital searching for information on their loved ones.
"We haven't heard anything from any of them, not among the injured, not among the list of dead," said one elderly woman, Sengul, whose two nephews worked in the mine along with the sons of two of her neighbors.
"It's what people do here, risking their lives for two cents ... They say one gallery in the mine has not been reached, but it's almost been a day," she said.
A mechanical digger opened a row of fresh graves at Soma's main cemetery. An imam presided over the funeral of six miners as a few hundred mourners wept in silence.
The fire broke out during a shift change, leading to uncertainty over the exact number of miners trapped. Energy Minister Taner Yildiz said the death toll as of 1930 GMT on Wednesday was 274, making it Turkey's deadliest accident. Late on Tuesday he said 787 workers had been in the mine.
Yildiz warned that "hopes were dimming" of finding many more survivors.
Turkey's safety record in coal mining has been poor for decades, with its previous worst accident in 1992, when a gas blast killed 263 workers in the Black Sea province of Zonguldak.
The mine operator Soma Komur Isletmeleri said nearly 450 miners had been rescued and that the deaths were caused by carbon monoxide. It said the cause was not yet clear.
Initial reports suggested an electrical fault caused the blaze but Mehmet Torun, a board member and former head of the Chamber of Mining Engineers who was at the scene, said a disused coal seam had heated up, expelling carbon monoxide through the mine's tunnels and galleries.
"They are ventilating the shafts but carbon monoxide kills in 3 or 5 minutes," he told Reuters by telephone.
"Unless we have a major miracle, we shouldn't expect anyone to emerge alive at this point," he said, pointing to an outside chance that workers may have found air pockets to survive.
The disaster highlighted Turkey's poor record on worker safety and drew renewed opposition calls for an inquiry into a drop in safety standards at previously state-run mines. The International Labour Organization ranked the EU candidate nation third worst in the world for worker deaths in 2012.
Erdogan earlier declared three days of national mourning and canceled an official visit to Albania. President Abdullah Gul also canceled a trip to China scheduled for Thursday in order to travel to Soma.
A pall of smoke hung above the area of the mine and Yildiz said the fire was still burning underground, hampering the rescue operation, which was halted for several hours as the evening wore on to allow exhausted rescuers to recover.
Turkey's disaster management agency AFAD said in an email 85 people had been treated for their injuries.
Freezer trucks and a cold storage warehouse usually used for food served as makeshift morgues as hospital facilities overflowed. Medical staff intermittently emerged from the hospital to read the names of survivors being treated inside, with families and fellow workers clamoring for information.
"This isn't a huge city. Everyone has neighbors, relatives or friends injured, dead or still trapped. I am trying to prepare my family for the worst," said Hasan Dogan, 27, watching TV news reports from a canteen set up outside the hospital.
Some 16,000 people from a population of 105,000 in the district of Soma work in the mining industry, according to Erkan Akcay, a local opposition politician. The district is no stranger to tragedies, but never before on this scale.
The words "For those who give a life for a handful of coal" are engraved on the entrance wall to the emergency clinic.
Teams of psychiatrists were being pulled together to counsel the families of victims. Paramilitary police guarded the entrance to the mine to keep distressed relatives at a safe distance, as residents offered soup, water and bread.
"They haven't brought any ambulances in such a long time that we've started to lose hope," said Hatice Ersoy, 43, a woman in a headscarf sitting on a pavement outside the hospital.
Turkey's rapid growth over the past decade has seen a construction boom and a scramble to meet soaring energy demand, with worker safety standards often failing to keep pace. It is a net importer of coal.
The Labour Ministry said late on Tuesday its officials had carried out regular inspections at the Soma mine, most recently in March, and that no irregularities had been detected.
But Hursit Gunes, a deputy from the main opposition Republican People's Party, said a previous request for a parliamentary inquiry into safety and working conditions at mines around Soma had been rejected by the ruling AK Party.
"I'm going to renew that parliamentary investigation demand today. If (the government) has been warned about this and they did nothing, then people will be angry, naturally. The opposition warned them. But there's unbelievable lethargy on this issue," Gunes told Reuters.
The ILO in 2012 said Turkey had the highest rate of worker deaths in Europe and the world's third-highest. In the mining sector, 61 people died in 2012, according to the ILO's latest statistics. Between 2002 and 2012, the death toll at Turkish mines totaled more than 1,000.