The history of the statue begins before Michelangelo's work on it from 1501 to 1504. Prior to Michelangelo's involvement, the Overseers of the Office of Works of Florence Cathedral, consisting mostly of members of the influential woolen cloth guild, the Arte della Lana, had plans to commission a series of twelve large Old Testament sculptures for the buttresses of the cathedral.In 1410 Donatello made the first of the statues, a figure of Joshua in terracotta. A figure of Hercules, also in terracotta, was commissioned from the Florentine sculptor Agostino di Duccio in 1463 and was made perhaps under Donatello's direction.Eager to continue their project, in 1464, the Operai contracted Agostino to create a sculpture of David. A block of marble was provided from a quarry in Carrara, a town in the Apuan Alps in northern Tuscany. Agostino only got as far as beginning to shape the legs, feet and the torso, roughing out some drapery and probably gouging a hole between the legs. His association with the project ceased, for reasons unknown, with the death of Donatello in 1466, and ten years later Antonio Rossellino was commissioned to take up where Agostino had left off.
Rossellino's contract was terminated soon thereafter, and the block of marble remained neglected for 25 years, all the while exposed to the elements in the yard of the cathedral workshop. This was of great concern to the Opera authorities, as such a large piece of marble not only was costly but represented a large amount of labour and difficulty in its transportation to Florence. In 1500, an inventory of the cathedral workshops described the piece as "a certain figure of marble called David, badly blocked out and supine." A year later, documents showed that the Operai were determined to find an artist who could take this large piece of marble and turn it into a finished work of art. They ordered the block of stone, which they called The Giant, "raised on its feet" so that a master experienced in this kind of work might examine it and express an opinion. Though Leonardo da Vinci and others were consulted, it was Michelangelo, only 26 years old, who convinced the Operai that he deserved the commission. On 16 August 1501, Michelangelo was given the official contract to undertake this challenging new task. He began carving the statue early in the morning on 13 September, a month after he was awarded the contract. He would work on the massive statue for more than two years.
On 25 January 1504, when the sculpture was nearing completion, Florentine authorities had to acknowledge there would be little possibility of raising the more than 6-ton statue to the roof of the cathedral.They convened a committee of 30 Florentine citizens that comprised many artists, including Leonardo da Vinci and Sandro Botticelli, to decide on an appropriate site for David. While nine different locations for the statue were discussed, the majority of members seem to have been closely split between two sites. One group, led by Giuliano da Sangallo and supported by da Vinci and Piero di Cosimo, among others, believed that, due to the imperfections in the marble, the sculpture should be placed under the roof of the Loggia dei Lanzi on Piazza della Signoria; the other group thought it should stand at the entrance to the Palazzo della Signoria, the city's town hall (now known as Palazzo Vecchio). Another opinion, supported by Botticelli, was that the sculpture should be situated on or near the cathedral. In June 1504, David was installed next to the entrance to the Palazzo Vecchio, replacing Donatello's bronze sculpture of Judith and Holofernes, which embodied a comparable theme of heroic resistance. It took four days to move the statue the half mile from Michelangelo's workshop into the Piazza della Signoria. Later that summer the sling and tree-stump support were gilded, and the figure was given a gilded loin-garland
In 1873 the statue of David was removed from the piazza, to protect it from damage, and displayed in the Accademia Gallery, Florence, where it attracts many visitors. A replica was placed in the Piazza della Signoria in 1910.
In 1991, a man attacked the statue with a hammer he had concealed beneath his jacket; in the process of damaging the toes of the left foot, he was restrained.