David Stern, who served as commissioner of the National Basketball Association for three decades, transforming a struggling league plagued with image problems into a billion-dollar business whose games are viewed by fans in more than 200 countries, died Wednesday in New York.

He had a brain hemorrhage while dining in New York on Dec. 12 and was taken to a hospital but did not recover. The NBA announced his death Wednesday afternoon. He was 77.

In a league of tall, sleek athletes capable of performing seemingly superhuman feats on the basketball court, the unathletic, 5-foot-9 Stern was unquestionably the most dominant figure in the NBA. A lawyer and league official before he was named commissioner in 1984, he stabilized a league that was tottering with its fan base shrinking and many of its teams losing money.

At the time, the NBA had 23 franchises, but the league was fading in popularity and public prominence. By the early 1980s, the NBA Finals were not even carried on live TV: They were shown late at night on tape delay. One season, no companies bothered making NBA trading cards.

Stern quickly consolidated power in the league’s headquarters, revamping business operations from the ground up. He instituted a draft lottery, in which the league’s worst teams drew numbers for the chance on drafting the best eligible players. (Previously, the two worst teams flipped a coin to see which would receive the top draft choice.)

The lottery became a huge media event that drew intense interest from fans and was presented live on television, with Stern announcing the draft picks and shaking hands with players who towered over him.

He led the NBA’s expansion to 30 teams, pushed out incompetent owners and encouraged struggling franchises to move to other cities. He negotiated broadcast contracts worth hundreds of millions of dollars; was instrumental in launching the WNBA, a women’s professional league under the NBA’s auspices; and brought a fresh approach to marketing that took advantage of the sport’s youth, diversity and international appeal.

When he took over the NBA’s top job, the league had 24 employees. When he retired in 2014, it had 1,200 employees, with offices all over the world, including three in China.

“Nobody, including me, envisioned that this young, bright attorney would have such marketing genius,” Abe Pollin, then owner of the Washington NBA franchise, told Sports Illustrated in 1991.