Lord Justice Thorpe, giving his ruling at the Court of Appeal, admitted the judgment might leave Alan Miller, 41, feeling that the courts had been hard on him.
Mr Miller's wealth is estimated to be £17.5m, with extra shares worth £18.11m. He told the court that he would have been financially better off if he had accidently run his wife over in his car.
The court said that although this was a short and childless marriage between a relatively young couple, the relationship had broken down because Mr Miller went off with another woman. An award of £5m, said the judges, was not excessive, for by marrying his wife, Mr Miller had given her an expectation of a significantly better life.
Lawyers said the case would be seen as a gold-diggers' charter. Sandra Davies, head of family law at the London firm Mishcon de Reya, said it was a "wake-up call" for men who feared losing their wealth in a short-term marriage. She said the ruling would encourage more couples to cohabit rather than wed.
The High Court family division judge Mr Justice Singer had ordered Mr Miller to pay off the £500,000 mortgage on the £2.3m couples' home in Chelsea, and hand it over to his ex-wife. In the settlement in April this year, Mr Miller was also ordered to pay Mrs Miller a lump sum of £2.7m.
The Court of Appeal accepted yesterday that this could not be challenged. Lord Justice Thorpe said that the case had generated "a good deal of professional interest". He said the result was not so reliant upon the facts, but on an assessment of whether the award was within "the generous ambit of discretion" open to Mr Justice Singer.
Lord Justice Thorpe said the marriage had been characterised as a £5m pay-off for a mere two and three quarter years of marriage. But, the appeal judge said, the couple had been together for four years prior to their engagement and she had committed herself to him. "The responsibility for the collapse of that endeavour must in part be ascribed to the husband's decision to end the marriage."Reuse content