The garden was founded on October 17, 1755, by King Ferdinand VI, and installed in the Orchard of Migas Calientes, near what today is called Puerta de Hierro, on the banks of the Manzanares River. It contained more than 2,000 plants collected by José Quer y Martínez, botanist and surgeon.
In 1774 King Charles III ordered the garden moved to its current location on the Paseo del Prado. This new site opened in 1781. Inside an area defined by wrought iron fencing, the design by architects Francesco Sabatini and Juan de Villanueva organized the garden into three tiered terraces, arranging plants according to the method of Linnaeus.. Its mission was not only to exhibit plants, but also to teach botany, promote expeditions for the discovery of new plant species and classify them. There was a particular interest in the botany of Spain's colonial possessions. The garden was greatly augmented by a collection of 10,000 plants brought to Spain by Alessandro Malaspina in 1794.