HBO took home the most Primetime Emmy Awards last night, beating every one of the broadcast networks. But writer-producer David E. Kelley was the evening's big success, snaring unexpected wins for best drama and best comedy series for ABC's "The Practice" and Fox's "Ally McBeal."

"I think you can see from the looks on our faces, we're all a little surprised, but we'll take it," Kelley said as he and the cast of "The Practice" came to pick up the best drama award.

Then almost immediately, the show's producers began pulling him back onstage to collect the best-comedy Emmy for "Ally McBeal."

"I thought they had made a mistake, and that 'The Sopranos' had won for best drama," Kelley said, adding that he thought he might have to give back the drama Emmy. Going into those last two categories, NBC and HBO were tied with seven wins apiece. But HBO had racked up five more Emmys than NBC had two weeks earlier during the non-televised portion of the ceremony. So even though Kelley's ABC show "The Practice" was named best drama--besting HBO's "The Sopranos"--and his Fox show "Ally McBeal" took best comedy--thumping HBO's "Sex and the City"--the cable network nonetheless finished the leader in the competition with a total of 23 wins, beating NBC, which has been the front-runner for several seasons past. NBC logged 17 wins, followed by ABC's 13, CBS's 11 and Fox's seven.

The Kelley wins were last night's only real surprises. Sure, it was "The Practice's" second consecutive win and, Lord knows, the Academy of Television Arts & Sciences likes handing out its hardware to the same people over and over. But HBO's critically heralded mob show had been the odds-on favorite to win that race.

And Kelley's controversial decision to enter his one-hour drama series "Ally McBeal" in the comedy competition--a strategy that bombed last year when "Frasier" rewrote the books with a record-breaking fifth consecutive win--paid off in its second year.

In the end, "The Sopranos" nailed only two wins during last night's "glamour" derbies, including Edie Falco's first-ever Emmy, for best lead actress in a drama series, as well as a nod for best drama series writing--no real surprise there since it had nabbed four out of that competition's five nominations. Added to the show's two other wins on "tech" night, this year's most nominated show took home home a total of just four Emmys--tied with "The Practice."

Mostly, the show that supposed to celebrate the best of television celebrated reruns. That includes not only "The Practice's" return win for best drama, but also Dennis Franz's fourth win for best lead actor for his "NYPD Blue" role and Helen Hunt's fourth in a row on "Mad About You"--both of whom had the good grace to seem somewhat embarrassed by their victories. Hunt's award tied a record for consecutive wins by a performer set in 1988 by John Larroquette for "Night Court." And John Lithgow, picking up his third win for best sitcom lead actor, said, "I really don't know why I have won this. As far as I can tell every actor in this town thinks what I do on '3rd Rock' is completely disgraceful. I'm embarrassed myself."

Even David Letterman took a second consecutive trophy, for best variety show. Which will definitely be news to the many fans who have bailed out of his late-night talker.

Some of the supporting actor contests also played like "repurposed" programming. That included the perennially nominated David Hyde Pierce's third win for best sitcom supporting actor on "Frasier" and three-time nominee Kristen Johnston's second win for supporting actress for her role on "3rd Rock."

The academy also proclaimed that "Frasier" was last year's best-written sitcom and ABC's freshman "Sports Night" was the best-directed sitcom--which makes "Ally McBeal's" win for best comedy series all the more surprising.

Same goes for "The Practice," which had none of the year's best lead actors, according to the academy, or the best writing, or directing--that win was awarded to Paris Barclay for the Jimmy Smits swan song episode of "NYPD Blue."

"The Practice" did, however, have two of the night's more memorable wins, to supporting actress Holland Taylor and supporting actor Michael Badalucco. Taylor beat out, among others, last year's winner Camryn Manheim, who had dedicated her trophy "to all the fat girls." Taylor dedicated hers to all the actresses over 40 "who can still cook."

Cable once again dominated the long-form races last night. HBO's "A Lesson Before Dying" was named the year's best TV movie and A&E's swashbuckling "Horatio Hornblower" the year's best miniseries. Then there was Stanley Tucci's win for best lead actor in a movie or mini for his role in HBO's "Winchell," and Helen Mirren's win for Showtime's "The Passion of Ayn Rand."

Broadcast did pick up a couple of long-form wins. Anne Bancroft was named best supporting actress in a miniseries or movie for her work on the CBS production "Deep in My Heart"; the miniseries directing nod went to NBC's "The Temptations." And Peter O'Toole won best supporting actor in a mini or movie for his role in CBS's miniseries "Joan of Arc."