"Buffy the Vampire Slayer" star Nicholas Brendon won't be spending any time behind bars for an alleged attack on two cops back in March ... that is, as long as he doesn't do anything stupid for the next three years.
The L.A. City Attorney's Office tells TMZ Brendon pled no contest to four misdemeanors on Friday -- one count resisting arrest, two counts of battery against a police officer and one count of vandalism.
We're told the commissioner sentenced Brendon to 36 months probation and gave him a one year suspended sentence in county jail -- meaning he won't serve time as long as he doesn't violate the terms of his probation.
Brendon must also complete 10 days in a Caltrans work program and complete an anger management course. Brendon is also not allowed to drink in public while he's on probation.
As we first reported, Brendon allegedly threw punches at police officers in Venice, CA on March 17 and then took off on foot. He was eventually tasered twice before he was taken into custody.