Jason Alexander, the ex-husband of Britney Spears, has been found guilty of aggravated trespass and battery charges, California officials say. 

Alexander, 40, pleaded no contest to the misdemeanor charges on Thursday, according to the Ventura County District Attorney's Office. 

Alexander was arrested at Spears' residence on June 9, where she and her husband Sam Asghari were tying the knot.

Authorities say Alexander – who was not invited to the nuptials – damaged a door and battered a security guard who attempted to remove him after he refused to leave the wedding.

BRITNEY SPEARS, SAM ASGHARI SLAM EX KEVIN FEDERLINE OVER CLAIMS THAT THEIR KIDS ARE AVOIDING HER

Britney Spears' ex husband Jason Alexander attempted to crash her wedding

Britney Spears and Jason Alexander were briefly married for 55 hours in 2004, when they were both 22 years old.  (Getty Images)

Alexander was credited with time served Thursday after spending 64 days in Ventura County Jail since the arrest. He is also under a criminal protective order, meaning he is barred from being within 100 yards of Spears and the security guard involved. 

BRITNEY SPEARS CONFIRMS SHE'S WRITING A BOOK, AIRS OUT FAMILY DRAMA

Spears and Alexander – who were childhood friends – got hitched on a whim in the early morning hours of Jan. 3, 2004. The couple, who were both 22 years old at the time, held their ceremony at the Little White Wedding Chapel in Las Vegas. Ben Affleck and Jennifer Lopez were recently wed at the same Vegas landmark last month. 

Britney Spears and Sam Asghari

Britney Spears and her husband, Sam Asghari, were married on June 9, 2022. (AP)

Spears' and Alexander's marriage was annulled 55 hours later – a decision Alexander says was forced by Spear's management and her mother, Lynne. The annulment claimed that Spears was "incapable of agreeing to the marriage" at the time.

Britney's first husband was reportedly arrested at her home on her wedding day

Britney Spears and Jason Alexander had been childhood friends before they decided to get married in 2004.  (Getty Images)

CLICK HERE TO GET THE FOX NEWS APP

"We were just looking at each other and said, ‘Let’s do something wild, crazy. Let’s go get married, just for the hell of it,'" Alexander told Access Hollywood a day after the marriage was dissolved.