Saturday Night Live's 40th anniversary special featured a star-studded lineup of guests, including Taylor Swift, who made a cameo in the episode's "The Californians" sketch.

The soap opera-like bit, which featured past SNL cast members Bill HaderKristen Wiig and Fred Armisen reprising their roles as wealthy California residents with exaggerated accents, saw Swift playing "cousin Allison," who "just got a small role in a Hollywood space movie." The singer got to try out her best "Californians" accent during the sketch, when Hader's character asked Swift's Allison to recite her line from the film.

At the end of the skit, Cecily Strong, playing a flight attendant alongside David Spade, gave Swift a chance to break character while ushering the "Californians" characters off set.

"Oh, wow, Taylor Swift, big fan ... buh-bye," Strong said, evoking laughs from the audience. "What, you didn't see it coming? It's on the cue cards!"

Swift hosted Saturday Night Live in 2009 and has also been a musical guest on the show. In 2014, she made a surprise appearance, along with actors Zooey Deschanel and James Franco, in Seth Rogen‘s opening monologue. She did not perform during the SNL 40 special.

Press play on the video above to watch the full "The Californians" sketch, which also includes cameos from Bradley Cooper and Betty White.

You Think You Know Taylor Swift?