Former Spain goalkeeper Iker Casillas said on Sunday his Twitter account was hacked after a post saying he was gay created a stir on the social media platform.

"Hacked account," Casillas said. "Luckily everything in order. Apologies to all my followers. And of course, more apologies to the LGBT community."

The follow-up came not long after a brief message that was posted on his account went viral.

"I hope I'll be respected: I'm gay," stated the tweet sent from his account, along with the hashtag "HappySunday," also in Spanish.

Former Barcelona defender Carles Puyol, who replied to Casillas' now-deleted initial tweet, issued an apology on Twitter on Sunday and said: "I made a mistake. I apologise for a stupid joke which was not made with any bad intentions but was completely out of order. I understand why it was offensive. All my respect and support the LGTBIQA+ community."

Iker Casillas with ex-wife

Adelaide United player Josh Cavallo, who came out last October, criticised Casillas and Puyol for apparently joking about coming out.

"Joking and making fun out of coming out in football is disappointing," Cavallo tweeted.

"It's a difficult journey that any LGBTQ+ people have to go through. To see my role models and legends of the game make fun out of coming out and my community is beyond disrespectful.