MAE SAI, Thailand — Thailand's prime minister says the 12 boys saved from a flooded cave were given an anti-anxiety medication to help with their rescue.

Asked at a weekly news conference Tuesday if the boys had been sedated, Prime Minister Prayuth Chan-ocha said, "Who would chloroform them? If they're chloroformed, how could they come out? It's called Anxiolytic, something to make them not excited, not stressed."

Prayuth also said the Tham Luang cave will be closed for some time. He said it needs to be made safe so it can be developed into a tourist destination.

Thailand's navy SEALs confirmed all 12 boys and their soccer coach have been rescued from a flooded cave in far northern Thailand, ending a dramatic ordeal that lasted more than two weeks.

They say the four boys and coach rescued Tuesday, after other rescues in the previous two days, are all safe.

The SEALs say they're still waiting for a medic and three Navy SEALs who stayed with the boys to emerge from the cave.

President Donald Trump congratulated the Thai navy SEALs and their international partners who rescued a youth soccer team and their coach after more than two weeks of entrapment in a cave.

Trump tweeted: "On behalf of the United States, congratulations to the Thai Navy SEALs and all on the successful rescue of the 12 boys and their coach from the treacherous cave in Thailand."

He added: "Such a beautiful moment - all freed, great job!"

Tham Luang cave
Rescuers wade in the flooded Tham Luang cave during a mission to evacuate the remaining members of a soccer team trapped in a flooded cave in Chiang Rai, Thailand July 10, 2018, in this still image taken from a video obtained from social media. Instagram @elonmusk/via REUTERS

Eight boys were freed on Sunday and Monday, with the remaining four and their coach rescued on Tuesday.

A team of foreign divers and Thai navy SEALs were took part in the audacious rescue: taking the boys from where they have been sheltering and through dark, tight and twisting passageways filled with muddy water and strong currents.

Two divers accompanied each of the boys, all of whom have been learning to dive only since July 2, when the first searchers found them.

Cave rescue experts consider an underwater escape to be a last resort, especially with people untrained in diving.

The death Friday of a former Thai navy SEAL, Saman Gunan, underscored the risks. The diver, the first fatality of the rescue effort, was working in a volunteer capacity and died on a mission to place oxygen canisters along the route.

Recent mild weather and falling water levels had created optimal conditions for an underwater evacuation. The potential for rising water and the dwindling oxygen levels added to the urgency of getting the team out. Efforts to pump water out of the cave have been set back by heavy downpours.

The boys and their coach, whose team is known as the Wild Boars, became stranded when they were exploring the cave after a practice game on June 23.