In a Los Angeles court Wednesday, Mel Gibson and ex Oksana Grigorieva finally reached a custody settlement over their daughter, Lucia, who was born in 2009.

The case seems a loss for Oksana. She will get only $750,000 over five years from a man once reported to be worth $900 million. He had reportedly offered her millions in the past, which she turned down. The terms of Wednesday's agreement:

    -Gibson will have to pay Grigorieva $750,000 over five years -- three installments of $250,000 -- one now, one in Sept. 2012 and one in Jan. 2016.

    -The house Grigorieva and Lucia live in must be sold when Lucia turns 18. The money from the sale will be put in a trust for Lucia.

    -Gibson and Grigorieva will have joint legal and physical custody of Lucia.

    -No books can be written by either party about the other.

The couple, who have been engaged in legal battles for months, separated in April 2010. Their relationship exploded online when audio was released of a fight between the two and Oksana accused Mel of physical abuse.

During the Wednesday hearing, Gibson and Grigorieva both thanked the judge.

Gibson is settling several matters this week -- he's also reported to have reached a settlement in his two-year divorce case with his wife of 28 years, Robyn. The divorce should be finalized this week.