Kelsey and Camille GrammerSETTLE Custody Case!!!

2/28/2012 11:54 AM PST BY TMZ STAFF

Kelsey Grammer and Camille Grammer have ended their custody war ... settling the dispute and doing it amicably ... TMZ has learned.

According to court documents obtained by TMZ, the case has officially been taken off calendar. Sources connected with the former couple tell TMZ ... Kelsey and Camille have agreed to joint custody of their 2 kids -- 10-year-old Mason and 7-year-old Jude.

We're told the kids will both continue living in Los Angeles with Camille, but Kelsey will maintain "meaningful contact" with both of them.