The 28-year-old "Tik Tok" singer will play Annabelle, a hostile neighbour of Jane, in the romantic comedy series that stars Gina Rodriguez as the virgin who got pregnant by accident, reported Female First.
Speaking about her reaction to being offered the part, the pop star gushed, "I was really excited! They called me randomly.
"I was finally supposed to have a day off because I hadn't had one in three weeks, and they called me and they were like, 'Can you do this audition?' And I was like, 'Ugh, today's my day off.' And they said, 'Oh, it's for Jane the Virgin.' And I said, 'Oh yeah'."
Another pop star, Britney Spears will also appear as herself in the fifth episode of the second season that airs on The CW channel.
"Jane the Virgin" returns October 12.