The mayor—whose third term in office ends Dec. 31—was featured on the late-night sketch comedy show’s Christmas Special, joining actor-comedian Seth Meyers and host Jimmy Fallon on their “Weekend Update” segment. All the city’s mayors since—but not including—Abraham Beame, who was in office to 1977, have appeared on the show, hosted at NBC Studios in Midtown.

Mr. Bloomberg gently mocked his own stringent public health laws and Spanish accent, while sending up his presidential ambitions, during his brief, two-and-a-half minute cameo.

Asked at the outset what he planned to do after leaving City Hall Jan. 1, Mr. Bloomberg replied, with his trademark dry delivery: “I’ll be fulfilling a lifelong dream of enjoying a small soda on a non-smoking beach.”

As the live audience erupted with laughter, Mr. Fallon asked if he had another job lined up. The departing mayor replied: “I applied to teach Spanish at a few universities, but I’m told my accent isn’t quite ‘bueno.’” Mr. Bloomberg has been a target for mockery after studying Spanish and choosing to deliver brief remarks in the language—in his typically flat, nasal tone—at press conferences.

The segment then wrapped up with Mr. Fallon, who takes over as host of the “Tonight Show” in January, joking that he feared getting “choked up,” at the prospect of leaving his current “Late Night with Jimmy Fallon” show. Turning to Mr. Bloomberg, he asked if the mayor expected to face the same problem leaving office.

“I might, I’m a very emotional guy,” the mayor deadpanned as the hosts looked on straight-faced.