The former mayor of New York, Rudolph Giuliani, has avoided a potentially damaging divorce trial with a last-minute settlement.

Lawyers for his estranged wife, Donna Hanover, say she was granted a divorce after Mr Giuliani admitted to cruel and inhumane treatment based on a relationship with another woman.

I am
relieved to be able to reach an agreement on all the terms and spare anyone any further pain, embarrassment or anything else

Rudolph Giuliani

Her lawyers say the ex-mayor awarded her more than $6.8m (£4.4m) as well as child support and litigation fees, and custody of the former couple's two children.

Mr Giuliani, who became a household name when he rallied the city in the aftermath of the 11 September terror attacks, said afterwards that he was glad the case was over.

"For the sake of the children, and really all of us I am
relieved to be able to reach an agreement on all the terms and spare anyone any further pain, embarrassment or anything else," he said outside the court.

Hanover: Married for two decades to Giuliani

The settlement came after lawyers for the two parties worked through the night, said Raoul Felder, Mr Giuliani's lawyer.

The couple's marriage ended after two decades when the then mayor began an affair with an employee, Judi Nathan.

Scandal

The then-mayoral couple's bitter separation was all over the front pages before the city was attacked on 11 September, the BBC's Jane Standley reports.

He became the only mayor in the city's history to have to move out of the mayoral mansion because of his domestic difficulties.

Mr Giuliani credits his girlfriend with having got him through his treatment for prostate cancer.

But his wife sued him for divorce on the grounds of "open and unusual adultery".