A Thai Navy Seal who was part of the dramatic three-day rescue of a youth soccer team from a flooded cave in Thailand in 2018 has died of a blood infection he contracted during the daring operation, officials said.

The Royal Thai Navy said Friday on Facebook that Petty Officer 1st Class Bayroot Pakbara was receiving treatment but his condition worsened after the infection spread into his blood. Officials did not disclose what specific infection Pakbara suffered from, or how he contracted it.

Pakbara, who was referred to as a "hero" by the Navy, will posthumously be promoted to the rank of lieutenant.

THAI CAVE WHERE SOCCER TEAM WAS DRAMATICALLY RESCUED REOPENS TO TOURISTS

According to the Bangkok Post daily, Pakbara was buried Friday at the Talosai mosque in southern Satun province.

Petty Officer 1st Class Bayroot Pakbara died last week of a blood infection contracted during the risky operation, according to officials. (Royal Thai Navy)

Local media quoted his mother as saying her son had been in and out of the hospital since the cave rescue.

The 12 Wild Boars spent more than two weeks trapped in Thailand's Tham Luang Nang Non cave complex after being flooded by annual monsoon rains. The last of the team members inside the cave were pulled out by July 10, 2018, drawing celebration across the world.

The boys and their coach entered the Tham Luang cave complex after soccer practice and were quickly trapped inside by rising floodwater.

Despite a massive search, the boys spent nine nights lost in the cave before they were spotted by an expert diver.

In this June 26, 2018, file photo, emergency rescue teams gather in the staging area during the cave rescue in Mae Sai, Chiang Rai province, northern Thailand. (AP Photo/Tassanee Vejpongsa, File)

After they were found, it would take another eight days of a highly-complex operation involving expert divers to get out by utilizing special stretchers.

Rescue operations required two divers to go out with each boy through the cave. (Fox News)

The operation required placing oxygen canisters along the path where the divers maneuvered dark, tight and twisting passageways filled with muddy water and strong currents.

To get the team out, Thai officials said experts had to guide them, diving through the cave's dark, tight and twisting passages. (Fox News)

The team's rescue almost ended in tragedy after the main pump malfunctioned, sending water into the caverns as the remaining rescuers were still trying to get out.

THAI CAVE BOYS WERE ACTUALLY HANDCUFFED, HEAVILY SEDATED DURING DRAMATIC RESCUE, NEW BOOK CLAIMS

Pakbara is the second navy diver who lost his life in the high-profile operation that saw the boys and the coach extracted from deep inside the northern cave complex.

Saman Gunan, a former Thai navy SEAL who assisted in the rescue, died while resupplying oxygen tanks on July 6, 2018, when he ran out of oxygen.

CLICK HERE FOR THE FOX NEWS APP

In November, Thailand's government officially reopened the cave to visitors after restoration efforts.

More than a million people have visited the cave over the past year, although no one has been able to go inside due to restoration efforts, the Bangkok Post reported at the time.

Officials now allow only 20 visitors at a time inside the cave's mouth and the first chamber, according to the news outlet.

Fox News' David Aaro and the Associated Press contributed to this report.