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.

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."

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.

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.