Selena Gomez made her “Saturday Night Live” hosting debut this weekend, and she got some unexpected support from her “Only Murders in the Building” co-star Steve Martin.

Martin — whose association with “SNL” extends back to its early years in the late 1970s — made a surprise appearance in a taped sketch titled “Inventor Documentary”.

READ MORE: ‘SNL’: Selena Gomez Talks Being Single And ‘Manifesting Love’ in Hosting Debut Monologue

In the bit, Gomez plays Taylor Gosh, host of the TV docuseries “American Inventors”, profiling inventor Archie Gizmo (Martin), inventor of novelty joke products.

According to Gizmo, his first big invention came about when he first met his future wife Dina Beans (Aidy Bryant), whose propensity to pass gas whenever she sat down inspired the whoopee cushion.

As it happened, Gizmo explained, Dina “wasn’t just a chronic gas-passer, she was also the most viciously unlucky woman I ever met,” with her various mishaps providing him with ideas for everything from fake snakes in a peanut can gag to the hand buzzer to “googly-eyed slinky glasses,” inspired by her eyeballs popping out of her sockets due to a sneeze.

Saturday Night Live” airs Saturdays at 11:30 p.m. ET/8:30 p.m. PT on Global.