In the weeks before the Summer Olympics in Rio de Janeiro, NBC officials believed that the prime-time audience for its 17-day event would match or exceed that of the London Games four years earlier. With stars like Michael Phelps, Katie Ledecky and Usain Bolt returning and a formidable United States women’s gymnastics team, NBC saw London’s overall viewership of 31 million as an attainable goal.

But so far that figure is looking unreachable. NBC’s performance stumbled early: Viewership for Friday’s opening ceremony fell 35 percent compared with four years ago, followed by a 28 percent tumble in the first day of competition. Although NBC has done better since, the average audience of 28.6 million after five days is down nearly 20 percent from the 35.6 million who were watching the London Games.

And viewership among people ages 18 to 34 has fallen 32 percent.

Normally this would be a cause of great anxiety at NBC, which has carried every Summer Games since 1988 and has $12 billion in deals to show all the Olympics through 2032. The prime-time broadcast on NBC brings in about three-quarters of its Olympic advertising and is counted on to attract hard-to-reach millennials and older viewers and to overwhelm rival networks in prime time.

“The main event on NBC is what we’re most concerned about,” said Billie Gold, the vice president and director of programming research at Amplifi, a division of the ad agency Dentsu Aegis Network, which has numerous clients advertising on NBC’s Rio broadcasts. “That’s where the big dollars are going.”