Some villages photograph well. Aínsa, in the Spanish Pyrenees near the French border, feels like walking into one. Stone ramparts, a hilltop castle and a trapezoid-shaped main square sit beneath peaks roughly 500 million years old — and the whole ensemble is a protected historic site in Spain, with roots as the capital of the ancient kingdom of Sobrarbe around the year 724.

The town's centrepiece is Aínsa Castle, begun in the 11th century and expanded over successive eras. It once guarded residents against Moorish and French invasions between the 11th and 17th centuries; today it houses the Sobrarbe-Pyrenees Geopark Center, an ecomuseum and the regional tourism office, plus hilltop views over the confluence of the Ara and Cinca rivers and the 7,500-foot cliffs of Peña Montañesa. A single former drawbridge gate links the castle to the Plaza Mayor, where Roman-style arcades, cobblestones and neutral-toned stone buildings frame a weekly Tuesday market and local festivals. Calle Mayor, running off the square, passes noble residences like 16th-century Casa Bielsa.

Towering over it all is the nearly 100-foot tower of the Church of St. Mary, started in the late 11th century and consecrated in 1181. Look closely and you'll see arrow slits — the church doubled as a defensive stronghold. Inside, later Romanesque and Gothic alterations are visible.

Here's the surprise: this tiny mountain village has a Michelin-starred restaurant. Callizo, set in the Plaza Mayor, runs an experiential tasting that starts in a basement shop, moves through an aperitif and a film about the Spanish Pyrenees, includes snacks in the kitchen, and only then settles you at the table. Chef-owners Josetxo Souto and Ramón Aso work with little-known local ingredients from regional producers, offering two tasting menus — Piedra and the grander Tierra — with wine pairings and mountain views.

The setting beyond the walls is half the reason to come. Ordesa y Monte Perdido National Park begins practically at the village edge, with waterfalls, hiking trails and glacier views below Mount Perdido's 11,000-foot summit. The park has been a UNESCO World Heritage Site since 1997, and its biodiversity and dramatic terrain explain why people have fought to hold this territory for centuries.

Getting there takes commitment, which is part of the charm. There's no direct rail service, keeping Aínsa pleasantly off the beaten track. Most visitors fly into Barcelona-El Prat and drive three to four hours, or transfer to the closer regional airport of Lleida–Alguaire, about 90 minutes away by car.

Aínsa suits travellers who want their mountain scenery with genuine history — not a resort town, but a fortified medieval core you can walk in an afternoon, with a Michelin meal at the end of it and one of Spain's great national parks on the doorstep.