Capdepera was built in 1300 by order of Jaume II, King of Mallorca to protect the citizens and shipping lanes from pirate attacks. This walled town became known as Capdepera Castle. His order to build this fortified was not popular with the locals, but they later survived many battles due to the fortified walls. Capdepera municipality is the closest point to the neighbouring island of Menorca, so the watch towers and fortress was must to have to defense the coast.
Capdepera castle has roughly 83 m2 with a wall and a ditch standing on the top of a hill. The Church of Our Lady of Hope and the Tower of Miquel Nunis are situated at the highest point on the castle grounds. Four towers were built at its eastern and southern sides. The wall around the enclosure is built in Gothic style.
In the 16th century, there were 125 houses inside the castle walls. A few hundred years later it became a military base and most of the population lived outside. The soldiers abandoned the castle in 1854 and in 1983 it became municipal property. Some of the houses can still be seen inside the castle.