The two codices were brought to Spain by Pompeo Leoni, a sculptor in the court of Philip II. After various changes of ownership, they were transferred to the monastic library of El Escorial and finally to the Biblioteca Real, where they remained unknown for 252 years.
The two volumes, containing 197 pages, are bound in red leather. Topics discussed include mechanics, statics, geometry and construction of fortifications. There is a list of 116 books Leonardo was using at the time, including some basic Latin grammar 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 friend Francesco Melzi. Over fifty years later Pompeo Leoni, a sculptor in the service of Philip II, purchased them from Melzi's son Orazio and brought them to Spain. When he died in 1608 the manuscripts were transferred to Juan de Espina, a friend of Francisco 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 future Charles I of England became interested in the manuscripts, and Juan de Espina bypassed the commitment, giving them to the King as a present. 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."
- Codex Madrid I (Ms. 8937) and Codex Madrid II (Ms. 8936) World Wide Emission.
- Codex Madrid I (Ms. 8937) "Treaty of statics and mechanics", 192 folios with 384 pages. Internal format: 215 x 145 mm.
- Codex Madrid II (Ms. 8936) "Treaty of fortification, statics and geometry". 158 folios with 316 pages. Internal format: 210 x 145 mm.
- The Madrid Codices. McGraw-Hill Inc, US, 1974. Five volumes, complete, with original manuscript, Italian and English translation.
- BNE, Leonardo interactivo
- Teresa Mosque Mesa, National Library (Espagne). (1989). Manuscripts of Leonardo da Vinci at the National Library. Madrid: Ministry of Culture.
- Leonardo da Vinci: anatomical drawings from the Royal Library, Windsor Castle, exhibition catalog fully online as PDF from The Metropolitan Museum of Art, which contains material on Codex Madrid (see index)