EXCLUSIVE

Madonna has rid herself of her massive Beverly Hills estate ... the one she bought during her marriage to Guy Ritchie ... and she pocketed a cool $8 MILLION in the process, TMZ has learned.

Madge had only listed the property back in January for $22.5 mil ... and just 10 months later, real estate guru Kurt Rappaport closed the deal for $20 mil. Not bad considering she bought the place in 2003 for $12 mil.

Real estate sources tell us ... the lucky guy who scooped up the pad is a Wall St. big shot.

The mystery buyer is clearly a fan of privacy ... 'cause the 17,000 square foot property is incredibly secluded -- with a 500 foot tree-lined driveway ... and massive trees covering the perimeter of the estate.

The home is insane -- with 15 bathrooms, 9 bedrooms, a 2-story dining room, pool, movie theater tennis court and a gym -- 'cause as we all know, Madge LOOOVES to pump iron.