COLUMBIA, S.C. -- The South Carolina Supreme Court on Wednesday overturned a settlement divvying up the multi-million dollar estate of James Brown, saying a former attorney general didn't follow the late soul singer's wishes in putting together the deal.

Attorney General Henry McMaster brokered a settlement in 2009 that split Brown's estate, giving nearly half to a charitable trust, a quarter to his widow Tomi Rae Hynie and leaving the rest to be split among his adult children.

But the justices ruled the deal ignored Brown's wishes for most of his money to go to charity. The court ruled the Godfather of Soul was of sound mind when he made his will before dying of heart failure on Christmas Day 2006 at age 73.

The court sent the estate back to a lower court to be reconsidered.

The justices did agree with the lower court's decision to remove Brown's original trustees. Members of Brown's family said they wanted them gone because the trustees mismanaged the estate until it was almost broke.

The court said it had no idea what the estate was worth, giving an estimate of $5 million to over $100 million.

The justices harshly criticized McMaster, who stepped in to broker the settlement after the estate floundered in court for years. Chief Justice Jean Toal suggested if the settlement was allowed to stand, it could prevent people from leaving most of their estate to charity because of fear their wishes could easily be overturned.

The dispute came to the court after the ousted trustees sued.

"The compromise orchestrated by the AG in this case destroys the estate plan Brown had established in favour of an arrangement overseen virtually exclusively by the AG. The result is to take a large portion of Brown's estate that Brown had designated for charity and to turn over these amounts to the family members and purported family members who were, under the plain terms of Brown's will, given either limited devises or excluded," Associate Justice John Kittredge wrote.

The fight over Brown's estate even spilled over into what to do with his body. Family members fought over the remains for more than two months, leaving Brown, still inside his gold casket, sitting in cold storage in a funeral home. Brown was eventually buried in Beech Island, S.C., at the home of one of his daughters. The family wanted to turn the home into a shrine for Brown similar to Elvis Presley's Graceland, but that idea has not gotten off the ground.