Gelbart co-wrote the long-running Broadway musical farce A Funny Thing Happened on the Way to the Forum with Burt Shevelove and Stephen Sondheim in 1962. After the show received poor reviews and box-office returns during its previews in Washington, D.C., rewrites and restaging helped; it was a smash Broadway hit and ran for 964 performances. Its book won a Tony Award. In a 1991 published edition of the musical, Gelbart wrote "it remains for me the best piece of work I've been lucky enough to see my name on." A film version starring Zero Mostel and directed by Richard Lester, was released in 1966. Gelbart was critical of the movie, as most of his and Shevelove's libretto was largely rewritten.