NEW YORK — Former NBA Commissioner David Stern suffered a sudden brain hemorrhage Thursday and had emergency surgery.

The league made the announcement about Stern's condition in a statement, saying its thoughts and prayers were with the 77-year-old Stern's family.

The following statement has been issued by the NBA pic.twitter.com/XgGB65ZFTg — NBA (@NBA) December 13, 2019

Stern served exactly 30 years as the NBA's longest-tenured commissioner before Adam Silver replaced him on Feb. 1, 2014. Stern has remained affiliated with the league with the title of commissioner emeritus and has remained active in his other interests, such as sports technology.

Stern oversaw the growth of the NBA into a league whose games were televised in more than 200 countries and territories and in more than 40 languages. The league was staging a regular-season game in Mexico City between Dallas and Detroit on Thursday night when it revealed the news about Stern.

People in and around the league offered prayers of support for Stern, with Hall of Famer Magic Johnson tweeting that he and wife Cookie were praying "for my good friend who helped save my life."

Join Cookie and I in praying for my good friend who helped save my life, former NBA Commissioner David Stern. He suffered a brain hemorrhage and had to have emergency surgery. 🙏🏾 — Earvin Magic Johnson (@MagicJohnson) December 13, 2019

Johnson announced he was retiring because of HIV in 1991 but returned the following year at the All-Star Game with Stern's backing, Johnson would later return to the league with Stern's support, even while some players were concerned about playing against him for health reasons.

Stern stayed busy after stepping down as commissioner, taking trips overseas on the league's behalf, doing public speaking and consulting. He was inducted to the Naismith Memorial Basketball Hall of Fame in 2014.

"We hope and pray for the best." - Coach Casey begins his postgame remarks speaking about NBA Commissioner Emeritus David Stern — Detroit Pistons (@DetroitPistons) December 13, 2019

Prayers up for David Stern.. — 🏁 Jamal Crawford (@JCrossover) December 13, 2019

Biggest prayers out to David Stern and the Stern Family....sad sad news, but we know he’s a fighter and will make it through! — Danny Green (@DGreen_14) December 13, 2019

Stern oversaw the addition of seven franchises and the creation of the WNBA and NBA Development League, now called the G League — which will have a franchise in Mexico starting with the 2020-21 season. Stern had a hand in numerous initiatives that changed the league, including drug testing, the salary cap and implementation of a dress code.

He wouldn't even let staffers use the word “retire” when he left his office, because he never intended to stop working. He has kept an office in New York and regularly travels into the city for work on the projects he pursued once he turned the league over to Silver.