The Toxic hitmaker broke the news on Tuesday (11Aug15) in a tweet to the show's stars Gina Rodriguez and Jaime Camil, writing, "See u at the Marbella Hotel soon... Guest starring on one of my favorite shows EVER @CWJaneTheVirgin #DreamComeTrue."

The pop star is set to play the nemesis of Camil's narcissistic telenovela star character Rogelio, in the upcoming second season of the show.

Spears' last small screen gig was in 2008, playing a receptionist in two episodes of How I Met Your Mother. She also graced the small screen in a 2006 episode of Will & Grace.