
TheMadrid Codices I–II (I – Ms. 8937 i II – Ms. 8936), are twomanuscripts byLeonardo da Vinci which were discovered in theBiblioteca Nacional de España inMadrid in 1965 by Dr. Jules Piccus, Language Professor at theUniversity of Massachusetts. The Madrid Codices I was finished during 1490 and 1499, and II from 1503 to 1505.[1]
The two codices were brought to Spain byPompeo Leoni, a sculptor in the court ofPhilip II. After various changes of ownership, they were transferred to the monastic library ofEl Escorial and finally to theBiblioteca Real, where they remained unknown for 252 years.

The two volumes, containing 197 pages, are bound in red leather.[citation needed] Topics discussed includemechanics,statics,geometry and construction of fortifications. There is a list of 116 books Leonardo was using at the time, including some basic Latingrammar books. The text is written in Italian dialect with some errors.
The manuscripts are of great importance as they contain about 15% of Leonardo's notes referenced today, but are also important for the quality and relevance of the works they contain, which are among the major engineering treatises of their time.
After Leonardo's death the codices were inherited by his pupil and heirFrancesco Melzi. Over fifty years laterPompeo Leoni, a sculptor in the service ofPhilip II, purchased them from Melzi's son Orazio and brought them to Spain.[2] When he died in 1608 the manuscripts were transferred to Juan de Espina, a friend ofFrancisco de Quevedo y Villegas, portrayed at the time as: "a gentleman who lives alone in a mansion in Madrid and his servants are wooden automata."
On a visit to Madrid in 1623 the futureCharles I of England became interested in the manuscripts, but Juan de Espina refused to sell them.[3] The Codex arrived at the Biblioteca Real in 1712, where for various reasons they remained lost until 1964. According to Martin Abad, manuscript manager for the library, their misplacement was "due to the transfer of the Biblioteca Real to four different locations, a fatal confusion of a signature and due as well to the aura of Da Vinci, which blinded many trying to attach their fame to that of the genius."