The series, which started as a spinoff of "Cheers," will end with an hour-long finale airing May 13.
"Ladies and gentlemen, that's a wrap," studio announcer and comedian David Willis said at the conclusion of the six-hour filming that went late into Tuesday evening.
The Paramount studio sound stage where "Frasier" spent its TV life was filled with family, friends and executives. Dinner was served to the audience of several hundred, and co-star Peri Gilpin even pitched in to pass around pizza.
As the cast gathered on stage for the final bow, series star Kelsey Grammer hugged each actor in turn, including co-stars David Hyde Pierce, John Mahoney, Jane Leeves and Gilpin. Guest stars included Laura Linney, Anthony LaPaglia, Robbie Coltrane, Richard E. Grant, Jason Biggs and Jennifer Beals.
The actors were poised as they moved for the last time from one familiar setting to another: The radio station where Dr. Frasier Crane, played by Grammer, dispensed advice; the Crane home with its centerpiece, a ratty armchair usually occupied by Crane's father, played by Mahoney; and the Cafe Nervosa, where the characters met to get their dose of caffeine and gossip.
"I'm never working this show again," Grammer quipped at one point, feigning annoyance after a muffed stage direction.
The last episode, which made room for laughs and tears, includes an Alfred Lord Tennyson poem recited by the erudite Dr. Crane. "That which we are, we are," he intoned.
The late David Angell, one of the series' creators, was recalled during the evening when Willis noted that Angell's sister was in the audience. Angell and his wife were aboard one of the planes that crashed into the World Trade Center on Sept. 11, 2001.
In its long run, the series became the most Emmy Award winning show ever, with 31 trophies, including five consecutive best comedy series awards.
The departure of "Frasier" leaves behind a comedy void at NBC and in television. The network is also seeing the end of its most successful comedy, "Friends," this season, while HBO's "Sex and the City" wrapped.