Apple CEO Tim Cook publicly came out as gay in an editorial published by Bloomberg Businessweek on Thursday. Cook said he hopes to help move civil rights forward. (Reuters)

Breaking his years of silence, Apple CEO Tim Cook wrote in an article that he is is “proud” to be gay.

Cook acknowledged in the essay published on Thursday that while his sexual orientation has not been a secret to many people at Apple (and has long been discussed and debated by outsiders, too), he has never before spoken publicly about the issue.

“While I have never denied my sexuality, I haven’t publicly acknowledged it either, until now,” Cook wrote for Bloomberg Businessweek. “So let me be clear: I’m proud to be gay, and I consider being gay among the greatest gifts God has given me.”

Cook took the helm of one of the world’s most successful companies after the death of its founder, Steve Jobs, in 2011.

The scrutiny that constantly follows the company inevitably centered on Cook. In profiles, Cook never explicitly addressed his sexual orientation, despite the sea change in public attitudes across the country about the issue of gay marriage. Same-sex marriage is now legal in 32 states and the District of Columbia.

Just this week, Cook urged his home state of Alabama to do more to protect gay rights.

In the essay, Cook said that this seismic change influenced his decision to speak out, despite concerns for his own privacy.

The world has changed so much since I was a kid. America is moving toward marriage equality, and the public figures who have bravely come out have helped change perceptions and made our culture more tolerant. Still, there are laws on the books in a majority of states that allow employers to fire people based solely on their sexual orientation. There are many places where landlords can evict tenants for being gay, or where we can be barred from visiting sick partners and sharing in their legacies. Countless people, particularly kids, face fear and abuse every day because of their sexual orientation.

I don’t consider myself an activist, but I realize how much I’ve benefited from the sacrifice of others. So if hearing that the CEO of Apple is gay can help someone struggling to come to terms with who he or she is, or bring comfort to anyone who feels alone, or inspire people to insist on their equality, then it’s worth the trade-off with my own privacy.

Over the years, Cook’s sexual orientation has inadvertently or intentionally been discussed in the media, including a recent accidental outing by a CNBC journalist. Shortly after that incident, Cook marched in a San Francisco gay pride parade.

Yet lesbian, gay, bi-sexual and transgender rights activists have also questioned why he declined to use his influence to support their cause.

“By taking a stand as an out gay man — and arguably the world’s most successful CEO — he can show his colleagues that it’s safe for them to come out,” a Queerty writer wrote. “And if they chose to do so, they’ll have a powerful ally.”

In a statement, LGBT advocacy organization, the Human Rights Campaign, said they are “incredibly grateful” for Cook’s announcement today.

“Tim Cook’s announcement today will save countless lives. He has always been a role model, but today millions across the globe will draw inspiration from a different aspect of his life,” said HRC President Chad Griffin. “Tim Cook is proof that LGBT young people can dream as big as their minds will allow them to, whether they want to be doctors, a U.S. Senator, or even CEO of the world’s biggest brand.”

Cook noted that his company, Apple, has actively supported LGBT rights as a matter of policy, and that his decision today brings his personal actions in line with that of his company.

“We’ll continue to fight for our values, and I believe that any CEO of this incredible company, regardless of race, gender, or sexual orientation, would do the same,” Cook wrote. “And I will personally continue to advocate for equality for all people until my toes point up.”

RELATED: Apple’s Tim Cook just publicly announced he’s gay. That’s extremely rare among business leaders.