The 33-year-old "Oops!... I did it again" hitmaker took to Twitter and said she will be making an appearance on her most "favourite" show, reported Us Weekly.
"See u at the Marbella Hotel soon, @hereisgina @jaimecamil! Guest starring on one of my favourite shows EVER @CWJaneTheVirgin #DreamComeTrue," Spears said.
Spears will appear in the fifth episode of the second season, which premieres on October 12.
"We are so thrilled that Rogelio's 'nemesis' -- Britney Spears -- has agreed to appear on 'Jane The Virgin'," creator Jennie Snyder Urman said.
Spears' acting credits include hit TV sitcom "How I Met Your Mother", popular show "Will & Grace" and 2002 film "Crossroads".