Mel B has agreed to pay her former nanny almost £2 million.

The Spice Girls singer had been due to face trial after she was sued for defamation by Lorraine Gilles, over claims the former 'America's Got Talent' judge branded her a ''homewrecker'' and a ''prostitute'' in court papers relating to her divorce from Stephen Belafonte but the pair have now reached an out-of-court settlement.

According to the Daily Mirror newspaper, both women agreed that ''keeping the matter under wraps was best for all'', so Mel agreed to pay Lorraine - who allegedly had threesomes with the 43-year-old star and her then-husband Stephen - around £1.8 million.

The settlement means the 'Stop' singer won't have to deal with the potential embarrassment of having details of her sex life revealed in court, or have her famous friends including Heidi Klum, Simon Cowell and her Spice Girls bandmates called up as witnesses if the case had progressed to trial.

The latter was something Mel was particularly keen to avoid in the wake of her recent claim she had slept with bandmate Geri Horner, who later denied the revelation.

A source said: ''Mel was just happy to clear this mess up once and for all.

''Things were said in court papers in the heat of a divorce, which exploded into this lawsuit. But in recent weeks their frost has thawed, with them even meeting in the same room to work out their differences.

''After the Geri controversy, the last thing she wanted was the rest of the band on the stand being probed all about her sex life.''

The 'Say You'll Be There' singer - who has three daughters from previous relationships - had previously argued to the court that she had no choice but to name Lorraine in order to get a restraining order against Stephen, but the court disagreed and sent the case to trial.

Mel appealed, but the Court of Appeal agreed with the original ruling.