Frantic efforts to save hundreds of miners trapped underground following an explosion and fire at a coalmine in western Turkey have continued, amid fears that the country was facing the worst mining accident in its history.

The prime minister, Recep Tayyip Erdogan, visited the mine in Soma and said the death toll from the accident had risen to 232. Almost 800 miners were working in the mine at the time of the explosion on Tuesday afternoon. By mid-morning on Wednesday, 363 miners had been rescued and more than 200 bodies had been brought out.

Hopes were fading for the remaining miners still underground. Turkey's worst mining disaster was a gas explosion near the Black Sea port of Zonguldak in 1992 that killed 263 workers.

Relatives were held back by barricades and security forces as they craned to glimpse the faces of men carried from the mine on stretchers. Erdogan declared three days of national mourning and all sports fixtures were cancelled. Erdogan and the president, Abdullah Gul, cancelled trips abroad in order to visit Soma.

"Regarding the rescue operation, I can say that our hopes are diminishing," said the energy minister, Taner Yildiz. "The problem is more serious than we thought. It is developing into an accident with the highest worker death toll Turkey has seen so far. We are worried that human loss could increase."

He said the accident occurred at the time of a shift change in the mine, with a high number of workers underground. The explosion is believed to have been triggered by a faulty electrical transformer.

A fire was still blazing inside the mine 18 hours after the blast, Yildiz said. Many deaths had been caused by carbon monoxide poisoning, and rescue teams were pumping oxygen into the mine.

A power cut caused by the explosion meant lifts were inoperable, trapping hundreds of miners about a mile below the surface and around two miles from the mine's entrance.

Nurettin Akcul, head of Turkey's mining union, said up to 150 workers were still in the mine. "We are doing all we can to bring out those who are still underground … there are another 100 to 150 people down there," he said.

The mine's owners, Soma Komur Isletmeleri, said the site operated under the "highest safety measures and constant controls". It said an investigation was being launched. "Our main priority is to get our workers out so that they may be reunited with their loved ones," the company said.

Turkey's labour ministry said the mine had been inspected five times since 2012, including in March this year, and no issues violating work safety and security had been detected.

However, a group of youths sprayed "murderers" on the building of the mine's operators, and other protesters lay down at an underground station in Istanbul pretending to be dead.

One local miner, Oktay Berrin, said workers were not protected underground. "There is no security in this mine. The unions are just puppets and our management only cares about money," he said.

The Turkish Red Crescent sent a team of 20 psychologists to the scene to counsel the bereaved. As bodies were brought out on stretchers, rescue workers pulled blankets back from the faces of the dead to give jostling crowds of anxious family members a chance to identify victims. One elderly man wailed after he recognised one of the dead, and police restrained him from climbing into an ambulance with the body.

Many relatives sat silently on benches in shock, while others scoured a list posted on a wall naming the wounded and the hospitals to which they had been taken. One young woman, Bahar Galici, stared at the sheet of paper before walking away. "Still nothing," she sighed.

Harun Unzar, a colleague of the missing miners, said he had lost a friend previously. "But this is enormous," he said. "All the victims are our friends. We are a family and today that family is devastated. We have had very little news and when it does come it's very bad."

A 30-year-old man who declined to give his name said he had rushed to the scene to try to help find his brother, but had been forced to retreat. "There is no hope," he said with tears in his eyes.

A minute's silence was held at the Turkish parliament, and international figures expressed condolences. Pope Francis appealed for prayers for the miners. "Dear brothers and sisters, I invite you to pray for the miners who died in the mine yesterday in Soma, Turkey, and for those who are still trapped in the tunnels. May the Lord receive the deceased in His house and give comfort to their families," he said at his general audience, according to Vatican Radio.

The European council president, Herman Van Rompuy, said the EU was "ready to assist Turkey in any way it may require in this difficult moment".