Katy Perry Katy Perry

Katy Perry is going to jail — but it's only for her guest role as a prison guard on Raising Hope.

The 27-year-old pop-star will appear on the Fox comedy's March 6 episode, the network announced Wednesday.

Katy Perry and Russell Brand finalize divorce

"[Cast member] Shannon Woodward

told me that her friend Katy was interested in doing an episode and I thought, 'Why not? Let's do your friend Katy a favor,'" said executive producer Greg Garcia in a statement. "Then she came in and did a terrific job. She was hilarious. And now people are telling me that Katy is also a singer. I sincerely hope that her appearance on the show helps her get her singing career off the ground. It's a tough business."In the episode, Sabrina (Woodward) finds herself under the watchful eye of Rikki (Perry), after being incarcerated during an Occupy Natesville protest. Rikki does everything in her power to make Sabrina's stay a miserable one — until she realizes the two are actually old friends.

Russell Brand files for divorce from Katy Perry

Perry married comedian Russell Brand in October 2010, but the two finalized their divorce earlier this month.Raising Hope moves to its new timeslot on Tuesday, March 6 at 8/7c on Fox.