The flag of the Papal State was originally gold and purple. In ancient times, the flag was yellow and red (or amaranth red), the two traditional colors of the Roman Senate and people, as well as the keys of the Holy See. In 1803, Pope Pius VII introduced a white flag with the keys of St. Peter and a tiara in the center for the merchant fleet of the Papal States. In 1808, he replaced the red color of the guards' flags with white, which gave rise to the gold and silver colors.
The appearance of the current colors of the Vatican flag is associated with the occupation of Rome by Napoleon's troops in February 1808. The commander of the French troops, General Miollis, imposed the inclusion of the Pope's armed forces in the imperial forces. The Papal Army was allowed to continue wearing the red and yellow cockade. On March 13, 1808, the Pope protested against the annexation of his states and asked the military corps loyal to him to replace the cockade in Roman colors with a white and yellow cockade. Three days later, on March 16, Pius VII transmitted this order in writing to the diplomatic corps. The document in question should be seen as a birth certificate for the colors of the current flag of the Vatican City State. General Miollis also approved new insignia for the papal soldiers who came under his command. On March 20, the Pope again protested to the French mission in Rome. The Holy Father regarded the incorporation of the troops and the adoption of a new coat of arms as the highest sign of indignation against his dignity. Napoleon learned of Pius VII's opposition. On March 27, the emperor ordered the adoption of the Italian or French tricolor cockade, providing for the death penalty for violators. A year later, on May 17, 1809, Napoleon issued a decree on the unification of Rome and the Papal State with France.

In 1815, the Papal State became independent again, and Pope Chiaramonti, not forgetting the episode of six years earlier, made the white and yellow cockade mandatory for the papal troops. In 1824, the merchant navy used the biancogialla, but with the colors arranged diagonally and then in the form of two vertical stripes. From 1825, this white and yellow flag was supplemented with the keys of St. Peter and a tiara in the white part. It was used until the disappearance of the Papal State in 1870.
It was not the only papal flag. Other types of flags were used by troops, fortresses, warships, and the public. In 1831, these colors were adopted for the flag of the Civil Guard and the Papal Infantry. In 1850, Pius IX added the keys and tiara in a white stripe. A variety of yellow and white flags were used by citizens, state fortresses, and the Palatine Guard. Their design changed periodically and included the emblems of the pope. The flag of the Papal Infantry appeared in 1862, white and yellow, without an emblem. Many of these flags are kept in museums or can be seen in contemporary art. In 1870, the famous flag was divided into two vertical stripes of yellow and white, with the keys and tiara in the center. This model remained in use among the Pope's supporters after the annexation of the state by Italy in 1870, until the fall of Rome and the creation of the Vatican. It served as the national flag of the Vatican and its related institutions. It was only after the Lateran Treaty between the Holy See and Italy of February 11, 1929, that the papal flag acquired its modern look. It was approved on June 7, 1929, in the State Constitution and first raised on June 8, 1929.