It’s Showtime.

The pay-cable network officially stepped out of HBO’s shadow Sunday at the 64th annual Emmy Awards, sweeping the major categories with its rookie  drama “Homeland.”

The spy series took awards for outstanding drama, actress (Claire Danes) and actor (Damian Lewis) — Showtime’s first Emmys in those categories. Lewis beat favorites Bryan Cran­ston of “Breaking Bad” and Jon Hamm of “Mad Men.”

In fact, “Mad Men” went home with nothing, losing its chance to make history by winning best drama five years in a row.

Equally surprising was the number of solid laughs throughout an event that can be deadly dull. Jimmy Kimmel succeeded in his inaugural turn as host, recruiting show-biz friends such as Tracy Morgan, who faked a collapse onstage for a Twitter prank, and Ellen DeGeneres, who lent Kimmel her pants in the opening bit.

Kudos also to the cast of “Modern Family,” who gamely poked fun at their prolonged contract talks, and to the reality-show hosts who were brave enough to spoof their disastrous job as Emmy emcees four years ago. “Modern Family” was victorious in every category in which it was nominated, winning best comedy for the third time. Another big winner was comedian Louis C.K., who collected two Emmys.

HBO’s “Game Change,” about the 2008 McCain-Palin campaign, won for best movie, writing, directing and lead actress Julianne Moore. Overall, it was a great night for movie stars, with Tom Hanks accepting as a producer for “Game Change,” and Jessica Lange and Kevin Costner both collecting awards.