Britney Spears' first husband was convicted of trespassing and battery after appearing at the singer's uninvited June wedding.
Jason Alexander, 40, pleaded guilty to the charges. A judge sentenced him to 64 days in prison - the time he has already served behind bars.
Security personnel were able to restrict his movement after he broke into the wedding of Spears and longtime partner Sam Asgari.
Britney Spears: My dad's tutelage killed my dreamsBritney Spears says she will publish her memoir in a book
Alexander married the pop star in 2004. But my childhood friend's marriage was annulled after 55 hour
Spears, 40, and Asghari, 28, tied the knot at a private party at the singer's home in Ventura County on June 9
But preparations were hampered by Alexander's arrival. Shortly before his arrival, Alexander appeared in a live broadcast on Instagram, in which he said he was there to "break in" the wedding.
The video clip showed him walking into Spears' house in search of her, before entering the wedding canopy, which was being finalized at the time.
Alexander claimed that Spears invited him, saying, "She's my first wife, my only wife."
Alexander was arrested and taken to a local prison. A police spokesman said at the time that Alexander "managed to make his way to the property and was confronted by security".
"An altercation occurred with the security personnel, and here the beating happened... During the quarrel, one of the belongings was broken, and from here comes the (accusation) of vandalism."
The party went ahead, despite the turmoil, and was attended by stars including Madonna, Paris Hilton, Selena Gomez, Drew Barrymore and Ansel Elgort.
In November, Spears was freed from a controversial 13-year legal guardianship under which her father, Jamie, controlled many aspects of her life.
Reportedly, her father, mother, and sister did not attend the wedding after relationships collapsed due to guardianship, and Spears' legal battle to end it.
Spears met her new husband, an athletic trainer, in 2016 on the set of one of her songs. Spears was married to dancer Kevin Federline from 2004 to 2007