Turkish Prime Minister Recep Tayyip Erdogan has weathered military coup plots, mass protests, corruption scandals involving his family and other political crises in the past year.

But a mining accident that took the lives of around 300 workers in western Anatolia on Tuesday is threatening to become his greatest challenge ever.

Mr. Erdogan has already stirred controversy by cracking down on political opponents and critics. Now, just as he may launch his candidacy as Turkey's first popularly elected president, he's facing the wrath of angry working-class Turks who have long been his loyal political base.

Story continues below advertisement

Rather than showing empathy or contrition for the Tuesday accident, which critics say was the resulted of lax enforcement of regulations overseeing powerful mining companies, Mr. Erdogan's response has been ham-fisted, suggesting he might not sail through this scandal unscathed.

On Wednesday, angry crowds who view Mr. Erdogan as complicit in the accident staged protests during his visit to Soma. As the crowds taunted him, the Prime Minister sought refuge in a supermarket, but not before he was filmed apparently slapping a protester and an aide was caught on film kicking a demonstrator being held on the ground by police. Earlier, he appeared deaf to the town's grief when he compared the mining accident to those in 19th-century Britain, hardly a comparison that portrays Turkey as the developed country he's presented to the world since he took office in 2003.

Anti-government protests continued in Soma on Friday – rare in the Erdogan heartland, and possibly a sign he may have lost touch with his core constituency.

The protesters are not the "usual middle-class urban secularists" who have long been uncomfortable or openly opposed Mr. Erdogan whom he has derided as "drunks and vandals," said Jenny White, a visiting professor at the Institute for Turkish Studies at Stockholm University. "The furious protesters were the relatives and neighbours of the miners, the sort of people who had been thought to make up the Prime Minister's core constituency," she said.

"People might write off government corruption and even the inevitability of industrial accidents," Prof. White added. "They will not forgive or forget the Prime Minister's tone-deaf response, callous lack of empathy, and disrespect toward suffering miners and their families."

Some Turkish political analysts maintained that the criticism of Mr. Erdogan is unfair. "The Prime Minister went there to support the mourners and to comfort them," said Recep Senturk, director of the Alliance of Civilizations Institute at Fatih Sultan Mehmet University in Istanbul. "There were some provocateurs from the opposition among the mourners in Soma who heckled and attacked" him.

The accident, and his response, has clearly complicated the political future for Mr. Erdogan, who barely two months ago was basking in the glow of the solid popularity of his Justice and Development Party (AKP). The party swept local elections in March, which he took as vindication after a string of corruption accusations and outcry over his attempt to block Twitter and YouTube in Turkey, and he has been widely expected to run for president in August.

Story continues below advertisement

"Protests are an indicator of growing polarization in Turkey," said Sinan Ulgen, head of the Istanbul Centre for Economics and Foreign Policy Studies. "Today they are targeting the mine catastrophe and tomorrow they will be against something else."

Mr. Erdogan, whose party came to power in 2002 and has held on to a majority ever since, has increased the role of Islam in Turkish politics, reduced the power of the armed forces that have traditionally ensured the Turkish government's secular bent and liberalized the economy. He has also come to be seen as a rigid authoritarian who has deployed riot troops against peaceful demonstrators and jailed journalists and critics. Reporters Without Borders has called Turkey under Mr. Erdogan "one of the world's biggest prisons for journalists."

The anger now with Mr. Erdogan has also been fuelled by reminders this week that he rejected an opposition request only last month to investigate safety conditions at the stricken mine. Unions had long opposed his mine privatization policy – the stricken one in Soma was privatized in 2005 – and now the explosion has galvanized rank and file workers who previously were inclined to trust Mr. Erdogan.

"Right now, we are focused entirely on the rescue effort," Kenan Dikbiyik, a representative of the Turkish miners' union, said. "But after it is finished, we will do everything possible to find who is responsible."

IHS Global Insight analyst Sean Harrison said Mr. Erdogan's formidable political machine will probably overcome setbacks related to the disaster without enacting the reforms labour groups desire.

"The public outrage caused by the disaster is likely to be insufficient to pose a risk to government stability," Mr. Harrison said in an IHS research note. "Pressure from business lobby groups will probably prevent stringent regulations legislation being imposed on the sector."

Story continues below advertisement

With a report from Agence France-Presse