The Daily Mirror has agreed to a permanent injunction against more revelations stemming from its infiltration of Buckingham Palace.
The Mirror says it exposed security flaws at Buckingham Palace
It had revealed details of life there, after reporter Ryan Parry got a job as a footman by using a false reference.
The Palace told the High Court the Mirror had exposed security flaws, but said much of the copy was an "unjustified intrusion of privacy".
However, it agreed to drop its claim for damages for breach of confidence.
The Mirror also agreed to surrender all unpublished photographs and other material, and not to republish any material already published.
The newspaper will also pay £25,000 towards the Queen's legal costs, although it insisted it had not lost out financially over the whole affair.
Richard Spearman QC, representing the newspaper, said it had agreed to a permanent injunction
to "avoid a long drawn-out court battle with Her Majesty".
Pictures published included photos of the Queen's breakfast table, complete with Tupperware boxes of cereal, the Earl and Countess of Wessex's suite and the Duke of York's bedroom.
Mr Spearman said the story was in the public interest as it exposed a security breach at the Palace.
The Queen's lawyer Jonathan Sumption QC said Mr Parry had signed a confidentiality clause when he took the job, undertaking not to reveal any official or personal details about life at the Palace.
He said the personal nature of the details published were "obvious and unjustified intrusions" of privacy.
"A large proportion of what Mr Parry wrote had nothing to do with lapses of security.
"It was a highly objectionable invasion of privacy, devoid of any legitimate interest."
After the settlement, Mirror editor, Piers Morgan said he was "delighted" the Queen had dropped her action.
"This was an important investigation, massively in the public interest, which
will lead to a complete overhaul of security around the Royal Family.
"If we had not carried out this investigation then the many flaws in the
security system surrounding the royals would not have been exposed.
"It was necessary to deploy subterfuge to establish how easy it would have
been for a terrorist to become a royal footman.
"I believe that the Royal Family will in time come to thank Ryan Parry for
doing them a favour by exposing very serious lapses in the security system at
Buckingham Palace and Windsor Castle."
The Palace said it had tightened its hiring procedures in
the wake of the revelations, and the government has launched an investigation into royal security.
The Queen had initially been granted a temporary injunction against the Mirror disclosing any further details, which had been set to expire at 1630 GMT on Monday.
Mr Parry's identity was revealed by the paper the same day US President George Bush arrived in the UK for a state visit.
Mr Bush stayed in Buckingham Palace, and the Mirror showed pictures of the bedroom used by the president and his wife.