Queen Elizabeth II obtained a temporary legal ban last week after The Daily Mirror ran a series of stories by journalist Ryan Parry, who obtained a job at the palace using a false reference. The injunction was due to expire Monday afternoon.
Lawyers for the two sides said the newspaper had agreed not to run any more stories based on Parry's work, and not to "syndicate further" information already published.
The Mirror published the stories while President Bush was a guest at the palace during his state visit to Britain last week.
They included details about the queen's breakfast arrangements, photos of royal bedrooms and accounts of Parry's duties, which reportedly included delivering chocolates to the guest quarters of Mr. Bush and his wife Laura.
The queen's lawyer, Jonathan Sumption, said the articles were a "highly objectionable invasion of privacy, devoid of any legitimate interest." Parry, who got the job under his real name but by supplying a false reference alongside a genuine one, signed an agreement of confidentiality when he went to work at the palace.
Richard Spearman, the lawyer representing Parry and the newspaper, defended the stories as a "classic piece of investigative journalism" that had exposed serious security lapses. But, he said, "The Mirror is pleased to resolve matters. It did not want a long, drawn-out legal battle with Her Majesty."
Daily Mirror editor Piers Morgan said he hoped the royal family "will in time come to thank Ryan Parry for doing them a favor by exposing very serious lapses in the security system at Buckingham Palace and Windsor Castle."
"It would also be fair to say that we did not have much more material to publish which would have added greatly to our investigation in any case," he added.
The Mirror also agreed to hand over unpublished photos and documents collected by Parry during his two months of service in the royal household, and to pay 25,000 pounds ($42,000) toward the queen's legal costs.
Sumption said the royal family "are entitled to a proper measure of privacy in their personal lives" and would take legal action against anyone who did not respect the "principles of ordinary human courtesy."
The palace said it had tightened its hiring procedures in the wake of the revelations, and the government launched an investigation into royal security.
By Jill Lawless