A Thai navy Seal has died from a blood infection he caught while rescuing 12 boys and their football coach from a flooded cave in northern Thailand.

PO Beirut Pakbara died while receiving treatment for the illness, the Royal Thai Navy said. Another rescuer, navy diver Lt Cmdr Saman Kuman, died during the mission.

The Wild Boars Academy’s coach, Ekapol Chanthawong, and 12 boys had gone to explore the Tham Luang caves in Chiang Rai province on 23 June 2018 when a downpour flooded the cave system and trapped them underground.

During the operation to extract the group from deep inside the cave complex, Saman died while resupplying oxygen tanks.

According to the Bangkok Post daily, Beirut was buried on Friday at the Talosai mosque in southern Satun province. Local media quoted his mother as saying her son had been in and out of the hospital since the rescue.

The boys and their coach entered the Tham Luang complex after soccer practice and were quickly trapped inside by the rising floodwater. They spent nine nights lost in the cave surviving on water dripping from the walls before they were spotted by an expert diver taking part in the massive search and rescue operation.

It would take another eight days before they were all safe. A team of expert divers brought each of the boys out of the cave on special stretchers. The operation required placing oxygen canisters along the path where the divers navigated dark, tight and twisting passageways filled with muddy water and strong currents.

• This article was amended on 30 December 2019 to clarify two names. In earlier versions Beirut Pakbara was named Beiret Bureerak in the subheading and text, and the spelling of Saman Kuman was inconsistent.