A refugee football player has returned home to a celebrity welcome in Australia hours after the threat of extradition to Bahrain was lifted three months after he was detained in Thailand.

Hundreds of supporters carrying welcome signs were waiting at Melbourne Airport on Tuesday when Hakeem al-Araibi arrived on a commercial flight direct from Bangkok.

Thailand had come under great pressure from Australia’s government, sporting bodies and human rights groups to free Mr al-Araibi so he could return home to Australia, where he has refugee status and plays semi-professional soccer.

Hakeem Al-Araibi, right, arrives in Melbourne, flanked by former Australia national team captain Craig Foster (David Crosling/AAP Image via AP)

Former Australia national team captain Craig Foster has been leading the campaign for Mr al-Araibi’s release.

He said he could not sleep until he received word from Bangkok that Mr al-Araibi’s flight had left.

Mr al-Araibi told the cheering crowd: “I would like to say thanks to Australia.

“It’s amazing to see all of the people here and all of the Australian people and all of the media who supported me.”

Thailand had come under great pressure from Australia’s government, sporting bodies and human rights groups to send Mr al-Araibi back to Australia, where he has refugee status and plays semi-professional football.

Foster was by al-Araibi’s side with an arm around the footballer as they faced the crowd.

“So this is the man, probably the most famous young man in Australia right now,” Foster said. “Something of this magnitude doesn’t happen without an incredible team behind, and there’s been an amazing coalition of people, right from around the world.”

Prime Minister Scott Morrison, who wrote twice to his Thai counterpart Prayuth Chan-ocha in a bid to secure Mr al-Araibi’s freedom, thanked Australians as well as Thai authorities.

“I want to thank all Australians for their support in achieving this outcome,” Mr Morrison tweeted.

“We are grateful to the Thai government and thank them for the way they have engaged with us to enable Hakeem to return to Australia,” he added.

Two Australian expert cave divers who had helped rescue 12 boys and their soccer coach from a flooded Thai cave in July also wrote to the Thai prime minister last week pleading for Mr al-Araibi’s release.

Anesthetist Richard Harris and Craig Challen, a retired veterinarian, were last month named joint winners of Australian of the Year Award trophies, one of Australia’s most prestigious awards.

“The issue had just gained more and more prominence and Richard and I both realised that we’re in a position to hopefully give the issue a little bit of a nudge and contribute in our own little way,” Mr Challen told Australian Broadcasting Corp.

Thai prosecutors on Monday submitted a request to a court to withdraw the case to extradite Mr al-Araibi to Bahrain, where he faces a 10-year prison sentence for an alleged arson attack that damaged a police station. He has denied those charges and says the case is politically motivated.

Prosecutors made the decision after Thailand’s foreign ministry sent their department a letter on Monday indicating that Bahrain had withdrawn its request for Mr al-Araibi, a Thai official said.

Officials in Bahrain said the country “reaffirms its right to pursue all necessary legal actions against” Mr al-Araibi.

Mr al-Araibi, a former Bahraini national team player, says he fled Bahrain due to political repression and that he fears torture if he returns.

He was detained at the request of Bahrain relayed through Interpol upon his arrival in Bangkok in November while on a honeymoon with his wife.