Mel Gibson and his legal team reached a deal with prosecutors Friday (March 11) that will see the actor avoid jail time after being charged with misdemeanor battery earlier in the day.

The actor appeared before a Los Angles judge and pleaded no contest to the charges. Under the terms of his agreement, Gibson must complete 16 hours of community service, enroll in a 12-month domestic-violence program and pay an assortment of court fees and fines.

Gibson also must obey a strict order to not annoy, harass or threaten anyone with violence while serving out his various punishments.

The actor has already begun reporting to a domestic-violence counselor and was ordered to submit a progress report during a status hearing June 9. By that date, the actor is also required to compete his community service, which he's scheduled to perform at the Mending Kids International facility. Gibson's deadline to complete his year of counseling is March 30, 2012.

The actor has 36 hours to turn himself in for booking.

The deal concludes an ugly split between Gibson and ex-girlfriend Oksana Grigorieva, the mother of his young daughter. The two dated briefly after Gibson and his wife of 26 years, Robyn, separated.

Gibson and Grigorieva were ensnarled in a bitter custody dispute that was compounded by lawsuits the two filed against each other.

Gibson accused Grigorieva of extortion and she alleged Gibson physically assaulted her.