Jason Collins has become the first active player in the NBA to come out as gay.

The 34-year-old, who played most recently for the Washington Wizards in an NBA career spanning 12 seasons and six teams, came out in an article with Sports Illustrated magazine.

He wrote: "I'm a 34-year-old NBA centre. I'm black. And I'm gay.

"I didn't set out to be the first openly gay athlete playing in a major American team sport. But since I am, I'm happy to start the conversation. I wish I wasn't the kid in the classroom raising his hand and saying, 'I'm different.'

"If I had my way, someone else would have already done this. Nobody has, which is why I'm raising my hand."

Collins said he was pleased he could finally "do the right thing" and "stop hiding".

He wrote: "No one wants to live in fear. I've always been scared of saying the wrong thing. I don't sleep well. I never have. But each time I tell another person, I feel stronger and sleep a little more soundly.

"It takes an enormous amount of energy to guard such a big secret. I've endured years of misery and gone to enormous lengths to live a lie. I was certain that my world would fall apart if anyone knew.

"And yet when I acknowledged my sexuality I felt whole for the first time. I still had the same sense of humour, I still had the same mannerisms and my friends still had my back." 

"I've endured years of misery and gone to enormous lengths to live a lie" - Jason Collins

He added: "Pro basketball is a family. And pretty much every family I know has a brother, sister or cousin who's gay. In the brotherhood of the NBA, I just happen to be the one who's out."

Collins, who is now a free agent, has reached the NBA finals twice and said he intended to continue his career.

President Barack Obama, a big fan of the NBA who regularly plays pickup basketball with his friends, called Collins to express his support, a White House official said.

"I can certainly tell you that here at the White House we view that as another example of the progress that has been made and the evolution that has been taking place in this country, and commend him for his courage, and support him in his - in this effort and hope that his fans and his team support him going forward," said White House spokesman Jay Carney.