During the Viceroyalty of Peru, the colonial-era Spanish flag flew over Peru.
The first flag of the Republic of Peru was created by General José de San Martín, and officially decreed on 21 October 1820.