William Shatner as Captain Kirk, first lady Michelle Obama as Jack Nicholson’s partner, Halle Berry as the Chrysler Building, Seth MacFarlane as host. TV critics may have hated Sunday’s 85th Academy Awards, but 40.3 million viewers lapped it up, making it the most watched entertainment program on TV in nearly three years.

Even more important to broadcaster ABC: The Oscarcast scored a nearly three-year record among viewers between the ages of 18 and 49, who are the currency of TV ad sales.

In particular, the network boasted the show’s 34 percent year-to-year ratings spike among 18-to-34-year-old men, who are the elusive unicorns of the ad world. The broadcast attracted 13 percent of the country’s 18-to-49-year-olds.

History will credit MacFarlane, whose success at reaching that young-guy group with animated TV shows has made him a darling at Fox — as well as at NBCUniversal, which distributed his like-minded box-office hit, “Ted.”

(In truth, the age of the audience has a lot more to do with the movies in the running for best picture — and six of this year’s nine best-picture nominees topped $100 million in box office by Sunday’s ceremony.)

The motion picture academy has been desperately trying to lure young viewers back to the trophy show, which led to the disastrous 2011 program when Anne Hathaway and James Franco co-hosted the show. They wound up doing worse with viewers their age than did oldsters Steve Martin and Alec Baldwin the previous year.

And the most successful Oscars ceremony of the past decade among young viewers was the 2004 show; it attracted 15.3 percent of the country’s 18-to-49-year-olds.

That year’s host: Billy Crystal.

That year’s winning movie: “Lord of the Rings: The Return of the King.”

MacFarlane delivered that for which he’s best known: cheap shots that send young males howling. Critics, too, but not in a good way.

It goes like this: MacFarlane observes that Quentin Tarantino’s best adapted screenplay winner, “Django Unchained,” is “the story of a man fighting to get back his woman, who’s been subjected to unspeakable violence — or, as Chris Brown and Rihanna call it, a date movie.” The fashion-whoring Oscar audience gasps. TV critics, who tend to take the Oscars way too seriously, cringe. And Robert Downey Jr., in the audience, applauds.

It played out much the same all night, as when MacFarlane broke out into the Hollywood starlets production number “We Saw Your Boobs.” And when he quipped about Daniel Day Lewis’s turn as the country’s 16th president: “I would argue that the actor who really got inside Lincoln’s head was John Wilkes Booth.” And on and on.

Much was made in the press the next morning of the panning that MacFarlane received on Twitter for his performance.

Of course, some on Twitter also panned the show, as WLJA’s Cynne Simpson noted, for booking people as old as Dame Shirley Bassey and Barbra Streisand to perform Sunday night. Bassey, in particular, being so old that when she first performed “Goldfinger” for the 1964 James Bond flick of the same name, Cynne hadn’t even been born yet, Cynne noted.

Using Twitter to determine the worth, or lack thereof, of a TV program is a mug’s game.

McFarlane’s audience was nearly 21 million people bigger than Tina Fey and Amy Poehler’s at the Golden Globes. MacFarlane’s audience also was 103 percent bigger than TF& AP’s among young viewers.

As he did at the unveiling of the Oscar nominees back in January, MacFarlane on Sunday predicted that Fey and Poehler would be asked to host next year’s Oscarcast. And that TV critics would fawn over it.

According to Nielsen, the MacFarlane-hosted Oscar broadcast ended at 11:40 p.m. — about 25 minutes before it ended in the real world. That means all those breaks you suffered through after 11:40 p.m. did not include any national ads and therefore don’t count.

Kimmel scores

After the Academy Awards, “Jimmy Kimmel Live” scored its second biggest audience ever — nearly 6 million viewers.

That’s about a million viewers more than last year’s post-Oscar “JKL,” which featured the release of the star-strewn trailer for the nonexistent flick “Movie: the Movie,” and Oprah Winfrey’s appearance on the show.

This year, Kimmel welcomed Channing Tatum and Jamie Foxx, and debuted the trailer for the slightly less star-studded sequel to the nonexistent movie “Movie: The Movie Twovie.”

The record for Kimmel’s late-night show remains its post-Super Bowl broadcast in February of ’06.

To read previous columns by Lisa de Moraes, go to washingtonpost.com/