Mel Gibson has agreed to fork over $750,000 to his baby mama Oksana Grigorieva as part of their custody settlement ... TMZ has learned.
According to the terms of the agreement, revealed today in court, Mel will give Oksana the money in 3 installments of $250,000 -- the first payment will be made when the deal is signed today.
The next payment will be made on Sept. 15, 2013 -- and the final payment will be made on Jan. 1, 2016.
Today in court, the judge in the custody case said the couple will have joint legal and physical custody of their daughter Lucia.
The judge also said the house that Oksana and Lucia are living in will be sold when Lucia turns 18 and the money will be placed in a trust for Lucia.
The couple also agreed that no books can be written by either party ABOUT the other party. The judge also mentioned that neither party can hire a ghost-writer to write a book about the other party either.
If any repairs need to be made on Oksana's home, Mel is required to pay for the work -- up to $5,000.
The judge asked both Mel and Oksana if they understood and agreed to the terms of the settlement -- and they both replied, "Yes."
During the hearing, Mel addressed the judge and said, "Thanks for a reasonable conclusion."
Oksana also spoke ... saying, "Thanks to the judge for the tremendous help to resolve this matter."