Alexander, 40, pleaded no contest Thursday to aggravated trespassing and battery, both misdemeanors, according to the Ventura County District Attorney's Office.
Prosecutors dropped charges of felony stalking and misdemeanor vandalism.
He got inside the house and up to the locked door of Spears' bedroom when she was inside getting ready for the wedding, according to testimony at a preliminary hearing.
Alexander was confronted by a security guard who tried to remove him from the premises. He battered the guard and also damaged a door during his attempt to enter the home, authorities said.
'Hold Me Closer': Britney Spears to return to music with Elton John collab
According to online court documents, Alexander was credited with time served for the 64 days he spent in Ventura County jail since the arrest. He was also issued a criminal protective order prohibiting him from coming within 100 yards of both victims.
"We're happy with the result," said Erin Meister, the supervising deputy DA who prosecuted the case.
"The defendant accepted responsibility for what he did on June 9 — he ended up spending two months in jail — and the victims' priority was the protective order," Meister said.
Alexander was married to Spears for three days in 2004 before the marriage was annulled.
Alexander’s attorney, Sandra Bisignani, did not immediately reply to an email from The Associated Press seeking comment. She previously said in court that there was no evidence he had any intention of harming Spears.
Spears' lawyer also declined comment to AP.
Contributing: The Associated Press
This article originally appeared on Ventura County Star: Jason Alexander: Britney Spears' ex guilty of trespassing, battery