Katy Perry has filmed a cameo for US TV show 'Raising Hope'.

The 'Part of Me' singer will appear in the Fox comedy series as curly and ginger-haired prison attendant Rikki who claims to be a lost-long friend of Sabrina Collins (Shannon Woodward) who is arrested after taking part in an Occupy Natesville protest.

Katy's character Rikki tries to make Sabrina's prison stint as miserable as possible, until she remembers that they were once close pals.

The 27-year-old pop star - who recently divorced husband Russell Brand - landed the role in the series due to her real-life Friendship with Shannon, executive producer Greg Garcia has revealed.

Greg quipped: ''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 favour.' ''

He jokingly added: ''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.''

Katy's episode will be screened in the US on March 6.