Horseraces, a spectacle common to many medieval cities, are documented as having taken place in Piancastagnaio at least since the sixteenth century. In high summer, with the harvest gathered in, the people could enjoy a festive period, overseen by three Lords and a Depositary who were responsible for organising events between 16 and 24 August (St Bartholomew's Day): these included dances, a big fair outside the walls, and a horserace for which the prize was a 'paglio' of silk embroidered with sacred images. In 1637 one of the festival supervisors was Francesco Nasini, who around the same time frescoed the Sanctuary of the Madonna di San Pietro. For every year in the seventeenth century there are documents in the municipal archives which pertain to the amount of money spent on the prize, sometimes named after the Madonna di San Pietro and sometimes after San Bartolomeo.
From 1800 the patronage of the festival passed to the Confraternity of San Filippo Neri, which organised a 'long' Palio (running from outside the Piazza di Castello to the Convent) and a 'round' Palio from outside Piazza di Castello and around the hilltop. Only in 1952 did Padre Carlo Fratini resurrect the old festival of the Madonna di San Pietro (18 August) with the participation of the ancient terzieri (districts), which are nowadays known as the contrade: Castello, Borgo, Voltaia and now also Coro (formerly Stretto). Thus we have the modern Palio of Piancastagnaio, which from 1979 began to be organised more thoroughly.
On 16 August the Festa degli Statuti kicks off the programme which concludes with the Palio. It also commemorates an important moment in the history of the town: the creation of a municipal judiciary and the codification of laws and customs in a single codex - the 'Statuti' (Statutes) - compiled by the Sienese Republic and the magistrates of Piancastagnaio. This great and vital stride towards modernity was celebrated with a popular festival and, one likes to imagine, a horserace. Every year on 12 August the Rector of the Magistrato delle Contrade appears in Piazza della Rocca and presents the people with the Statutes, drafted by the Grand Council in 1416, and swears to abide by them, to respect them and to see them respected. The drummers and other marching musicians of the contrade then pay homage to them with a competition for a shield known as 'Asta e Bacchetta'. On the evening of 17 August all members of the Judiciary and various representatives of the contrade accompany the procession of the Madonna di San Pietro, in whose honour the Palio is held the following day with the four quarters (Borgo, Castello, Coro and Voltaia) all vying for the prize drapery. The contrada that performs best over the whole festive period wins the Cupello, a decorated ceramic plate.