The 45-year-old, from Sarn, Bridgend, said keeping a secret had been the hardest part of the diagnosis.

“I’ve been living in fear of it being published,” he told BBC Radio Wales on Wednesday, adding: “The tabloids will create their own law.

“You’ll send them a letter and all they’ll do is ignore it. I haven’t got the money to be able to fight a giant tabloid in court.

“When they do it they’ll somehow find justification for doing it. They’ll say it’s ok, a family member told us something.”

In a Twitter video, Thomas had said he was compelled to make the announcement after threats were made to him by “evils” to reveal his HIV status.

Asked if he would have spoken about his HIV status without the press involvement, he replied: “I would love to sit here and say yes but I’d be a hypocrite if I did.

“Absolutely not. It’s got nothing to do with anyone else.”

He spoke out the day after Stokes called a front page story in the Sun newspaper about his family “utterly disgusting” and “the lowest form of journalism”.

It had dealt with “deeply personal and traumatic events” that had affected his family in New Zealand more than 30 years ago.

The Sun told the BBC it had received the co-operation of a family member.

‘Media ethics’

Damian Collins MP, chair of the parliamentary digital, culture, media and and sport committee, told BBC Wales: “I don’t believe there is any public interest in putting people under that sort of pressure.

“Putting them in that sort of situation, I think that is a private matter… It should be entirely a decision for [Thomas] to take.”

Image copyrightPA MediaImage caption Ben Stokes said he was ‘disgusted and appalled’ by the Sun’s story

Angela Phillips, professor of journalism at Goldsmiths University, London, who gave evidence at the Leveson inquiry into media ethics, said stories like those of Stokes and Thomas were a question of ethics rather than press freedom or the law.

She told BBC 5Live: “We’ve now got ourselves into a situation in this country where our tabloid press, partly because of the internet and social media and the way of which stories now travel is that anything that brings in money is justifiable.

“They seem to have lost any sense of whether this story is going to do so much harm to the people whose background you’re revealing that you shouldn’t touch it with a barge pole.”

However, speaking after the Stokes story broke, Ian Murray, executive director of the Society of Editors, said care had to be taken over the principle of a free press.

“I’m not defending the Sun – what I am defending is the principle and saying let’s be very careful about what we do.”

He continued: “We have a free press. It’s such a jewel in the crown of any free society. And there are always the sharks circling, the politicians, the rich, the powerful who would like to see that free press closed down.”

‘Absolute legend’

On Saturday, Thomas said he wanted to show how people with HIV were misrepresented as needing walking sticks and “close to dying”.

The following day he completed the gruelling Ironman in 12 hours and 18 minutes cheered on by crowds and with high emotion along the way.

Since making the announcement, support for Thomas has flooded in.

It has included a message from the Duke of Sussex, Prince Harry, on the social platform Instagram where he said: “Gareth, you are an absolute legend! In sharing your story of being HIV+, you are saving lives and shattering stigma, by showing you can be strong and resilient while living with HIV.”

Prince William also tweeted his support to the former player.

Thomas tells his story in a documentary being screened on the BBC on Wednesday.

Gareth Thomas: HIV and Me will be shown on BBC One Wales on Wednesday 18 September at 21:00 BST, and on the BBC iPlayer.