On January 3, 2004, Spears married childhood friend Jason Allen Alexander at The Little White Wedding Chapel in Las Vegas, Nevada. The marriage was annulled 55 hours later, stating that Spears “lacked understanding of her actions”. She began The Onyx Hotel Tour in support of In the Zone in March 2004. On June 8, 2004, Spears fell and injured her left knee during the music video shoot for “Outrageous”. She was taken immediately to a local hospital, where doctors performed an MRI scan and found floating cartilage. The following day, Spears underwent arthroscopic surgery. She was forced to remain six weeks with a thigh brace, followed by eight to twelve weeks of rehabilitation, which caused The Onyx Hotel Tour to be canceled. During 2004, Spears became involved in the Kabbalah Centre through her friendship with Madonna. In July 2004, she announced her engagement to American dancer Kevin Federline, who she had met three months before. The romance received intense attention from the media, since Federline had recently broken up with actress Shar Jackson, who was still pregnant with their second child at the time. The initial stages of their relationship were chronicled in Spears’s first reality show Britney & Kevin: Chaotic, and they married on September 18, 2004. Shortly after, she released her first fragrance with Elizabeth Arden, Curious, which broke the company’s first-week gross for a perfume. In October 2004, Spears announced she would be taking another career break to start a family. Greatest Hits: My Prerogative, her first greatest hits compilation album, was released in November 2004. Spears’s cover version of Bobby Brown’s “My Prerogative” was released as the lead single from the album, reaching the top of the charts in Finland, Ireland, Italy and Norway.The second single, “Do Somethin’”, was a top ten hit in Australia, the United Kingdom and other countries of mainland Europe. Worldwide, Greatest Hits: My Prerogative sold over 5 million copies.
Spears gave birth to her first child, Sean Preston Federline, on September 14, 2005. In November 2005, she released her first remix compilation, B in the Mix: The Remixes. The album consists of eleven remixes and a new track titled “And Then We Kiss”. In February 2006, pictures surfaced of Spears driving with her son Sean, on her lap instead of in a car seat. Child advocates were horrified by the photos of her holding the wheel with one hand and Sean with the other. Spears claimed that the situation happened because of a frightening encounter with paparazzi, and that it was a mistake on her part. The following month, she guest-starred on the Will & Grace episode “Buy, Buy Baby” as closeted lesbian Amber Louise. She publicly announced she longer studied Kabbalah in June 2006, explaining, “my baby is my religion”. Two months later, Spears posed nude for the cover of Harper’s Bazaar. The picture was heavily compared to Demi Moore’s August 1991 Vanity Fair cover. She gave birth to her second child, Jayden James Federline, on September 12, 2006. On November 7, 2006, Spears filed for divorce from Federline, citing irreconcilable differences. Their divorce was finalized in July 2007, when the couple reached a global settlement and agreed to share joint custody of their children. Spears’s aunt Sandra Bridges Covington, with whom she had been very close, died of ovarian cancer in January. On February 16, 2007, Spears stayed in a drug rehabilitation facility in Antigua for less than a day. The following night, she shaved her head with electric clippers at a hair salon in Tarzana, California. She admitted herself to other treatment facilities during the following weeks. After completing a month-long program at Promises, she wrote on her website, “I truly hit rock bottom. Till this day I don’t think that it was alcohol or depression. [...] was like a bad kid running around with ADD.” In May 2007, she produced a series of promotional concerts at House of Blues venues, titled The M+M’s Tour. Spears lost physical custody of her children to Federline on October 1, 2007. The reasons of the court ruling were not revealed to the public.
Her fifth studio album, Blackout, was released in October 2007. It debuted at the top of charts in Canada and Ireland, number two in the U.S. Billboard 200,—held off from the top spot by Eagles’s Long Road out of Eden— France, Japan, Mexico and the United Kingdom and the top ten in Australia, Korea, New Zealand and many European nations. In the United States, Spears became the only female artist to have her first five studio albums debut at the two top slots of the chart. Blackout sold over 3.1 million copies worldwide. Peter Robinson of The Observer said that “Britney has delivered the best album of her career, raising the bar for modern pop music with an incendiary mix of Timbaland’s Shock Value and her own back catalogue.” Dennis Lim of Blender commented, “Spears’s fifth studio album is her most consistent, a seamlessly entertaining collection of bright, brash electropop.” Blackout won Album of the Year at MTV Europe Music Awards 2008 and was listed as the fifth Best Pop Album of the Decade by The Times. Spears performed the lead single “Gimme More” at the 2007 MTV Video Music Awards. The performance was panned by many critics. David Willis of BBC stated her performance would “go down in the history books as being one of the worst to grace the MTV Awards”. Despite the backlash, the single rocketed to worldwide success, peaking at number one in Canada and the top ten in almost every country it charted. The second single “Piece of Me” reached the top of the charts in Ireland and reached the top five in Australia, Canada, Denmark, New Zealand and the United Kingdom. In December 2007, Spears began a relationship with paparazzi Adnan Ghalib.