David Duchovny and Tea Leoni

David Duchovny and Tea Leoni have legally divorced after splitting three years ago, TMZ reports.

The Californication actor filed for divorce in June, citing an irreparable  breakdown of the relationship. The pair will share joint legal custody of their two children, but Leoni will maintain primary physical custody. Duchovny will pay $40k a month in spousal support in addition to $8,333 a month in child support. He will also cover expenses including  summer camp, private school and college.

Fall preview: Get scoop on your favorite returning shows 

Duchovny and Leoni married in 1997, but split in 2008. During their separation, Duchovny underwent treatment for sex addiction and the couple reconciled shortly after only to split again in 2011.

Binge Saturday —  See why you should catch up on Sherlock: