LOS ANGELES (Reuters) - Mel Gibson and his ex-girlfriend on Friday settled a deeply bitter custody dispute over their young daughter which led to the Oscar winners plea of no contest to domestic violence earlier this year. Los Angeles Superior Court said in a statement an agreement was complete and terms will be heard on August 31. A spokesman for the Braveheart film director confirmed the parties had settled. We appreciate all the judges help, the spokesman said in a statement. It was not immediately clear whether the custody deal between Gibson and Oksana Grigorieva over their daughter Lucia settled all of the legal problems between the two. Gibsons spokesman declined further comment. Gibson and Grigorieva had a long-running relationship that involved the breakup of his marriage and the birth of their daughter but it began to unravel in early 2010. Grigorieva claimed Gibson punched her and broke her tooth during a heated argument in January that year. In March, the Passion of the Christ director admitted in front of a judge that he slapped Grigorieva with an open hand during an argument in which he was concerned for the safety of Lucia. He pleaded no contest the equivalent of guilty and was sentenced to three years probation.