 The song was co-written and produced by Max Martin, who wrote hits for Spears' first albums, including "...Baby One More Time" (1998) and "Oops!...I Did It Again" (2000).This marked the first time they worked together since her third studio album, "Britney" (2001).