Britney Spears is ending her own 7 years war with Sam Lutfi ... the ex-manager who accused her of rampant drug abuse and slandering his name -- the case has settled.
Lutfi and Spears reached the settlement agreement late last week ... according to docs obtained by TMZ. Sources familiar with the situation tell us ... Britney paid Lutfi "in the low 6 figures," but less than the estimated $500,000 in legal fees it would have cost her to defend the lawsuit.
Lutfi filed the defamation case against Britney and her family back in 2009, claiming the entire Spears clan was bad-mouthing him and blamed him for her downfall ... after she was hospitalized in 2008. Lutfi claimed they were outta line because the real problem was Britney's drug abuse, which he tried to stop.
A judge tossed his case in 2012, but Lutfi appealed and got a second bite of the apple. A trial was set to begin in L.A. next month.