allen and tawana iverson*In the case of divorce, it’s always cheaper to keep her  as the saying goes.

For former NBA star Allen Iverson that rule also applies, but he didn’t adhere to it because when the smoke cleared his bank account took a $3 million hit to make his now ex-wife, Tawanna,  ride off into the sunset.

We’re told Iverson and Tawanna — who married way back in 2001 — informed a judge last week they had reached a financial settlement outside of court in their ongoing divorce case … just days before the two were set to go to trial.

Sources connected with the couple tell TMZ … as part of the deal, the NBA legend agreed to pay Tawanna $3 million, paid out as a large lump sum. We’re told Iverson also agreed to fork over various assets and a percentage of his future Reebok endorsement deal checks. He’ll pay up child support payments for the duo’s five kids.

On the bright side for Iverson, we’re told he scored the couple’s GA mansion (which is currently facing foreclosure … so not so bright) and gets to keep his primo ride, a Maybach, as well as other personal belongings.

The settlement comes after a brutal year-long fight between the former lovers … which included allegations of infidelity, hiding money, and petitions for restraining orders.