The Guano Era refers to a period of stability and prosperity in Peru during the mid-19th century. It was sustained on the substantial revenues generated by the export of guano and the strong leadership of president Ramón Castilla. The starting date for the guano era is commonly considered to be 1845, the year in which Castilla started his first administration. It ended shortly after the war between Spain and Peru in 1866.