In June 1231, needing his main army for Valencia, King James I of Aragon staged a ruse along the Capdepera coast, thirty-seven kilometers across the channel from Muslim-ruled Menorca. For several nights his men lit over three hundred brushwood fires to simulate an encamped invasion host. On 17 June, Menorca's qadi, Abu Abd Allah Muhammad, signed the Treaty of Capdepera, traditionally linked to the summit watchtower of Torre d'en Miquel Nunis, accepting Aragonese sovereignty and annual tribute in grain, livestock, and butter.
That square Andalusi tower, built of rammed earth (tàpia) on a masonry plinth between the tenth and twelfth centuries, anchored King James II's 1300 plan for a fortified town atop Puig de Capdepera, 159 meters high and nearly two kilometers inland. James II projected an enclosure of 82,525 square meters, but local farmers (gabellins) resisted leaving their scattered holdings. Builders instead enclosed 8,069 square meters within a roughly triangular Gothic circuit of limestone and marès sandstone ashlar, finished by 1386 and later strengthened along its east and south curtains by four barrel-vaulted flanking towers. Sixteenth-century Ottoman corsair raids swelled the settlement inside from fifty stone cottages to one hundred fifty.
At the northern corner, beside a fourteenth-century emergency cistern, stands the church founded in 1323 as Sant Joan and rededicated in 1871 to Our Lady of Hope, which preserves a Gothic orange-wood Christ. After Bourbon reforms in 1715 installed a military governor and dragoon garrison, residents gradually moved downhill. An early nineteenth-century landowner dismantled half of Torre d'en Miquel Nunis to build a round mill and spiral stair before the governor halted work; a separate cylindrical windmill, Molí d'en Cofeta, stands outside the southeast wall. Decommissioned in the mid-1850s, auctioned into private hands in 1862, and transferred to the municipality in 1983, the castle uses its eighteenth-century Governor's House to exhibit sacred art alongside the Museu de la Llata, showing how local women sun-dried, sulfur-bleached, split, braided, and spirally sewed wild garballó palm leaves into baskets and hats.