Downing Street officials were aware of emails between Lord Mandelson and Jeffrey Epstein when Sir Keir Starmer defended the peer during Prime Minister’s Questions.
Sir Keir, who picked the Labour grandee to be the UK’s representative in Washington, made the decision to withdraw him after emails were published showing Lord Mandelson sent supportive messages even as Epstein faced jail for sex offences.
The Foreign Office received a media enquiry outlining details of the messages on Tuesday, which was passed to No 10, the PA news agency understands.
A Government source said Sir Oliver Robbins, the permanent under-secretary at the Foreign Office, asked Lord Mandelson about the emails but did not hear back until Wednesday afternoon.

The Prime Minister is understood not to have been aware of the contents of the emails until Wednesday evening – after he told the Commons he had “confidence” in Lord Mandelson during Prime Minister’s Questions at midday.
The decision to sack Lord Mandelson with immediate effect was taken on Thursday morning and announced shortly afterwards.
Downing Street and the Foreign Office said the emails showed “the depth and extent” of Lord Mandelson’s relationship with Epstein was “materially different from that known at the time of his appointment”.
The emails were sent from an account which had long been closed and were not available during the vetting process.
Allies of the peer told The Times that he admitted in his vetting interview that he continued his relationship with Epstein for many years.
Sir Keir and the Foreign Office are facing questions over what they knew and when about the ex-ambassador’s ties to Epstein.

Dame Emily Thornberry, chairwoman of Parliament’s Foreign Affairs Committee, is demanding answers from the Foreign Secretary on the vetting process for Lord Mandelson.
His friendship with Epstein was known before his appointment, but reports in The Sun and Bloomberg showed their relationship continued after the financier’s crimes had emerged.
Emails published on Wednesday afternoon included passages in which Lord Mandelson told Epstein to “fight for early release” shortly before he was sentenced to 18 months in prison.
He is also reported to have told Epstein “I think the world of you” the day before the disgraced financier began his sentence for soliciting prostitution from a minor in June 2008.
Sir Keir is under pressure after the second scandal-hit departure for the Government in a week after Angela Rayner quit over her tax affairs.
Downing Street said on Friday that Sir Keir has “confidence in his top team” when asked whether questions had been raised over the judgment of chief of staff Morgan McSweeney, who was reported to have lobbied for Lord Mandelson’s appointment.

Backbencher Clive Lewis publicly questioned Sir Keir’s leadership, telling the BBC the Prime Minister does not seem “up to the job”.
Barry Gardiner, another MP from the party’s back benches, said “toxic” resentment was festering among the party’s MPs and rank and file members.
Lucy Powell, one of two candidates in the race to take Ms Rayner’s place as the Labour Party’s deputy leader, called for a “change of culture”.
“We’ve got a bit of a groupthink happening at the top, that culture of not being receptive to interrogation, not being receptive to differing views,” she told The Guardian.
Newly appointed Foreign Secretary Yvette Cooper said during a trip to Ukraine that the decision to sack Lord Mandelson was “rightly taken” and backed Sir Keir’s “strong leadership”.
Scotland Secretary Douglas Alexander told BBC Breakfast he understood why Labour MPs were “despondent” after the last week’s events, but said action had been taken and the Government was looking forward to moving on.