It took more than £10m, 400 craftsmen and years of devotion to turn a derelict French chateau into a hotel with a client list of the world's glossiest stars. Now its proud parent has passed her baby on to complete the next stage of its 800-year life

It wasn't the end of A Year in Provence, so much as the closing chapter of two decades in Beaujolais. On Thursday, Lady Hamlyn, the widow of publishing magnate Paul, sold a 13th century French chateau for £17 million.

The Chateau de Bagnols, a honey-coloured pile amid vineyards, forests and rolling hills an hour from Lyon, was bought by Von Essen, the luxury hotel group that owns some of Britain's swankiest properties, including Cliveden in Berkshire, setting of the Profumo affair.

Behind the scenes, this was no ordinary, multi-million pound property deal, though. The chateau, one of the world's most famous and exclusive hotels, was previously the subject of perhaps the most ambitious and detailed restoration project attempted.

Bought with her husband, a self-made philanthropist and Labour donor, during the late 1980s, it took Lady Hamlyn four years to convert the crumbling medieval building into a five-star retreat, with a regular guest-list that reads like a Who's Who of global celebrity.

Tom Cruise and Nicole Kidman used to rent the entire property for weeks on end during the 1990s. More recently, should you stroll through its landscaped gardens, you might have bumped into Barbara Streisand, Naomi Campbell, or Bill and Hilary Clinton enjoying a sundowner.

Yesterday, as Lady Hamlyn showed the new owners around the Chateau's 22 comfortable bedrooms, she recalled the extraordinary and painstaking care that returned a once-ruined building to its former glory.

"I've done what I can here," she said. "I've restored it and I'm proud of the fact that its been on the Best Hotels in the World list ever since it opened. It's my baby, really, but now it's time to hand over to a pro."

When Lady Hamlyn first set eyes on the Chateau de Bagnols, it was little more than a rotting shell, with cracked walls, and a roof like a sieve. The moat was a muddy ditch, and more than a hundred rooks lived in one of its derelict towers.

It had been built between 1217 and 1221 by Guichard d'Oingt, an ally of the Archbishop of Lyon, and improved by subsequent owners, who included Geoffroy de Balzac, chamberlain to the French king Charles VIII.

However, after the Second World War, the building was left to crumble by its owners, a large aristocratic family called the Bouchoux-Chavannes. It was put up for sale following the death of a maiden aunt, who resided there in what Lady Hamlyn describes as "the most appalling conditions".

By the time the Hamlyns arrived rainwater could cascade inside, wrecking Renaissance frescoes and rotting its ornate carvings, wall-paintings and historic fireplaces.The cobbled courtyard looked like a bomb-site. In fact, it was a bomb site: dynamited by a previous owner searching for treasure looted by the Nazis. "It wasn't safe even to go inside," Lady Hamlyn discovered on her first visit. "I thought 'this is too much, even for me'."

Yet the place continued to haunt her, and a year later Lady Hamlyn returned with husband in tow. "We could see the wonderful view, and its golden stone glowing, and I knew it deserved to be saved. In a weak moment, my husband agreed, and that's where our problems began."

The resulting project is said to have cost more than £10m, and saw 400 specialist builders and craftsmen working day and night to return the building to its Gothic and Renaissance glory.

Lady Hamlyn, now 74, studied at the Royal College of Art, and worked as head designer for Cresta Silks, part of Debenhams, prior to her marriage in 1970. She had a passion for old buildings, and had previously carried out extensive projects on her properties in the UK.

"I don't think you could do the same thing today," she said. "These were people who were not young. They had been working for Monuments Historiques, mostly restoring old churches. For a private house, things were different and they learned a lot."

Unlike other restoration projects, the craftsmen working on Bagnols were required to use historic materials at all times. "The roof was repaired using old wood, and all the tiles are period tiles," she said.

Rotting beams were stripped out to give rooms their original proportions, and all the soft-furnishings were made with antique fabrics. Outside, a formal garden was created, with avenues of limes and cherry trees replacing what had been a wilderness.

The process sparked a running battle with Monuments Historiques, the French version of English Heritage. "We had a ghastly time with them. They had classified it as a 19th century interior, and didn't know that all these incredible older paintings and frescoes were hidden behind the newer facades.

"I wanted to take the building back as far as we could, but they just didn't understand it. It was a fight, because they said 'you can't touch anything'. They were threatening to stop the works, and it turned into a bit of a battle royal."

Finally, the building opened as a private hotel in 1992, run by Lady Hamlyn, who was swiftly lauded for her work on it by the French government, appointing her Chevalier de l'Ordre des Artes et Lettres.

"We'd always intended it to be a hotel. We didn't want another home for us, but I am keen on restoring broken down homes, and there wasn't another luxury hotel in the area."

Every detail of the interior was either created from Lady Hamlyn's collection of antiques, tapestries and objets d'art, or commissioned from specialist suppliers. "I made sure I designed everything, from the napkins to the towels to the silver. Nothing came off a shelf," she says.

Such was the level of the outlay on the luxurious chateau that guests would joke that her Ladyship would lose £50 for every person that stayed. Staff knew every guest's name; the restaurant was Michelin-starred; it became the ne plus autre of boutique hotels.

Then, in 2001, Lord Hamlyn died. As one of Britain's most generous philanthropists, who had built a £350m business empire from a bookshop started in Camden with £350, he left a string of charitable trusts for his widow to manage.

Two years later, Rocco Forte Hotels were bought in to help run the chateau. It came as only a slight surprise when news emerged this week that it had finally been sold.

"Lord and Lady Hamlyn were very, very close," says a friend. "They were one of those couples who were friends as well as husband and wife. This was their project, their dream, and I think when he died quite young from cancer she felt that the chateau became a bit of a tie."

Richard Power, the Managing Director of Rocco Forte, was offered the chance to bid for the chateau, but instead recommended Von Essen as a more suitable buyer. "It's just not the right scale for us, but a very good fit for them," he says. "They signalled to the Stock Exchange that they want to move out of the UK, and this is their first step."

The deal between Lady Hamlyn and Von Essen's colourful owner, the entrepreneur Andrew Davis, was brokered last week by Farrer's, the Queen's solicitor. Lady Hamlyn will retain a role as an informal consultant to the firm.

"She has immense affection for the place, but wants to concentrate on other things," says Anthony Edwards, at Farrer's. "She's very philanthropic, her charity is extremely active and takes up a hell of a lot of time.

"I think it's rather sensible of Davis to keep her on. She knows everything about the chateau. Like exactly why a bath is in a certain place, for instance, because if it wasn't the ceiling would collapse."

Yesterday, Lady Hamlyn took Mr Davis and his Creative Director, Andrew Onraet, on an in-depth tour of the property, detailing ongoing restoration projects that still need to be completed. "Some of the 18th Century fabrics used in upholstery need to be replaced. A lot of its in stores around the chateau, though," said Mr Onraet. "She bought a lot of antique fabrics at auctions over the years."

Von Essen intends to maintain the building largely as it is, though a major restoration of the cellars is due to take place in the coming years. They will be converted into a health spa.

Lady Hamlyn, meanwhile, will carry on searching for new restoration projects. Her Helen Hamlyn Trust carries out a variety of such projects, and also funds medicine, the arts and culture. It recently helped with the restoration of the Naguar fort in India, winning a UNESCO prize.

"I told the Maharaja of Jodhpur that we'd match the Paul Getty Foundation's grant, but only if he'd let me play an active part," she says. "I hope to carry on doing up buildings. I'm not a hotelier, really, but I am very good at restoration."

The plutocrats and A-listers relaxing at Chateau de Bagnols next summer will no doubt be inclined to agree.