Heather Locklear can avoid serving any jail time stemming from her two arrests last year if she completes a 30-day stay in a residential mental health facility.
The former "Melrose Place" star pleaded no contest to eight charges of battery and resisting officers, according to Radar Online.
Locklear was given a suspended sentence of 120 days in jail, so if she doesn't complete the 30 days of treatment ... she gets the jail time.
The actress has until September 6 to enroll in the treatment facility.
Locklear was first arrested in February 2018 for felony domestic violence and battery on a police officer.
Officers responded to her home in Thousand Oaks for a domestic violence call and say she was "extremely agitated, uncooperative and antagonistic" before they could even start the investigation.
The Ventura County Sheriff's Department says Heather "battered her boyfriend and he suffered a visible injury" before their arrival. As they tried to take Locklear into custody, she kicked and hit three deputies as they were bringing her to the vehicle and she remained "agitated and extremely uncooperative."
Then in June of 2018, Locklear was arrested again, this time for allegedly attacking a law enforcement officer and an EMT.
According to the Ventura County Sheriff's Office, officers responded to a disturbance call (placed by one of Locklear's family members) at her home. Upon arrival, officers found that Locklear was "heavily intoxicated" and arguing with another person.
When the deputy stepped in to intervene, Locklear struck the deputy (somewhere on the body, but not the face). The deputy was not injured but Locklear was immediately detained.
Paramedics were called to the scene to have Locklear checked out and as the EMT was examining her, Locklear allegedly kicked the EMT. She was then taken into custody and hauled off to jail.
Locklear was hospitalized a week prior to that arrest after allegedly threatening to kill herself. Dispatch audio from the incident described Locklear as a “suicidal subject” and that she was “trying to hurt herself and looking for a gun to shoot herself.”