NEW YORK (AP) -- There could be a new king emerging in late-night television.

David Letterman's CBS "Late Show" whipped NBC's "Tonight" show with Conan O'Brien in the ratings last week by nearly 800,000 viewers, according to Nielsen Media Research. Letterman generally lost to "Tonight" when Jay Leno was the host, and he hasn't had this big a victory margin since returning from heart surgery in 2000.

A late-night generation gap also appears to be emerging: The median age of O'Brien's audience last week was more than 10 years younger than Letterman's. NBC says that's good news, since advertisers pay a premium to reach youthful audiences.

In the 18- to 49-year-old age demographic for which NBC sells advertising, O'Brien won each night last week, NBC said.

Still, Letterman has won two of the past three weeks among all viewers during which both men competed with original programming. And the "Late Show" received another boost Wednesday with an attention-getting appearance by Paul McCartney.

"We feel we've got the momentum going for us right now, and we feel very confident," said David Poltrack, CBS' chief researcher.

He said network executives had privately been hoping that Letterman could gain ground against O'Brien and take over first place in the fall. The situation is still fluid, but changes seems to be happening faster than they expected, Poltrack said.

Significant numbers of the traditional late-night audience have made the switch, even though O'Brien continues to be very popular with young viewers who liked him when he was on a later time slot.

Still, many older viewers are "realizing this isn't the `Tonight' show anymore, it isn't what I'm used to," Poltrack said.

Last week Letterman averaged 3.68 million viewers, compared with O'Brien's 2.82 million, Nielsen said.

"The business we're in is selling viewers in the 18- to 49-year-old age group to advertisers, and Conan is doing very well by that measure," said Rick Ludwin, NBC's top late-night executive. "In fact, he's doubling the competition in the younger half of that group. It's going to take months and years for the ultimate ratings tale to be told but so far, we're very pleased at how younger viewers are clearly shifting to Conan."