Its a modern story of an ancient fairytale castle: a crowdfunding effort online has raised 1.6 million euros ($1.9 million) to restore a chateau in western France.
Around 25,000 people from 115 countries have become shareholders in the chateau de La Mothe-Chandeniers which has turrets, a moat and an elderly owner who had not maintained it.
The 19th-century building has fallen into disrepair with trees and vegetation sprouting out of its roof and windows, raising fears that it might be knocked down and redeveloped by property developers.
Thanks to a joint effort by online fundraising site Dartagnans.fr and a local association Adopte un Chateau (Adopt a Chateau), sufficient money has been raised to buy and restore the structure.
"It's a record in France and probably in Europe in terms of the amount raised and the number of contributors," the head of Dartagnans, Romain Delaume, told AFP on Tuesday.
The website offered buyers the chance to become shareholders in the castle at the cost of 51 euros: 50 euros as a donation for the restoration work and one euro to buy a share in a joint company set up to manage the site.
Organisers initially hoped for around 10,000 people, but thanks partly to reports in the French media the final number of donors came in at just under 19,000.
Many of them bought shareholdings for friends and family as presents, meaning that the total number of owners of the chateau will be around 25,000.
Most of them are from France, but people from as far afield as Afghanistan, Burkina Faso and Peru now have a small slice of history in the French countryside near the wine-growing Loire valley.
"Bravo for this initiative both collective and private," wrote the aristocratic speaker of France's parliament, Francois de Rugy, on Twitter. "France's historic buildings need a diverse range of ideas to be saved and developed."
The current chateau de La Mothe-Chandeniers dates back to the 19th century but the site has been home to a castle since at least the 13th century.
It was pillaged after the French Revolution in 1789 and heavily damaged in a fire in 1932 before being bought by its current owner, an 82-year-old local man, in 1982.
A thorough survey will be undertaken in the next few weeks to check the scale of the damage to the structure and the site will then be secured pending the start of restoration work.
Various ideas have been floated for the future from turning it into a "collaborative and creative laboratory", somewhere for artists to work, or a bed-and-breakfast holiday destination.
Getting all the shareholders to agree might be a challenge.
They will be invited for a visit "as soon as possible in 2018," said Delaume, and will be asked to take part in the restoration work.
He also stressed that not all of the building can be returned to its former glory because a complete overhaul has been estimated to cost at least 3.0 million euros.
Another round of fundraising in the future has not been excluded.