The injunction came after the Duke and Duchess of Cambridge took action against France's Closer magazine for selling and distributing the images.
The publishers must give the originals to the couple within 24 hours.
The magazine will face a fine of 10,000 euros (£8,000) for every breach if it re-publishes or distributes the photos.
The photographs were taken while the duchess was sunbathing on a private holiday with her husband at the French chateau of the Queen's nephew, Lord Linley, in Provence, earlier this month.
The couple says the publication by the magazine breached their privacy.
The ruling came after prosecutors said they were considering whether there were grounds for criminal charges.
The decision to begin the preliminary criminal probe follows a formal complaint by the royals to prosecutors, with aides saying they were looking for proceedings against both the magazine and the photographer who took the pictures.
Applying for the injunction on Monday, Aurelien Hamelle, the lawyer representing Prince William and Catherine, said the scenes captured were intimate and personal and had no place on the front page of a magazine.
But a lawyer for Closer earlier claimed the royal couple's reaction was disproportionate.
The royal couple are on a Diamond Jubilee tour of South-east Asia and the South Pacific and are currently in the island nation of Tuvalu.