Manchester United has invited the Thai soccer team rescued from a cave after 17 days underground to a match at Old Trafford this season.

The 12 boys and their coach became trapped in the cave system after heavy rain in northern Thailand on June 23, and the mission to bring them back to the surface has gripped the world's attention.

On Tuesday, the final members of the team were brought out to complete the rescue, and the news has been welcomed across soccer.

United hailed the news and offered a trip to Manchester during the 2018-19 campaign for the group and their rescuers.

"Manchester United is greatly relieved to learn that the 12 footballers and their coach trapped in a cave in Thailand are now safe," the club posted on Facebook. "Our thoughts and prayers are with all those affected. We would be honored to welcome the team from the Wild Boars Football Club and their rescuers to Old Trafford this coming season."

Roma also took to social media and paid tribute to the diver who lost his life trying to save the boys.

Its Twitter post read: "The best football news of the summer – ALL 12 young Thai players and their coach have been rescued after being trapped in a cave in Thailand for two weeks.

"Our thoughts are with the family of ex-Navy SEAL diver Saman Kunan who died after delivering the boys oxygen. A real hero."

Bundesliga champion Bayern Munich added: "Bayern is delighted to hear of the successful rescue of the young football team and their coach in Thailand. We wish them all the best for the future."

A statement from LaLiga read: "LaLiga celebrates the joyous news that after over 2 weeks, ALL twelve children and their coach who were trapped in the Tham Luang cave in Thailand have been RESCUED successfully and can soon return to their family and friends."

Meanwhile, World Cup semifinalist Kyle Walker offered to send the team England shirts following the news of their rescue.