The first settlements in the territory of Gaeta date back to the 9th-10th centuries B.C., after being an integral part of the Aurunca region in 345 B.C. the territory of Gaeta came under the influence of Rome.
Under Roman influence Gaeta became a popular resort; emperors, senators, consuls and wealthy patricians used to spend their vacations in their villas built here.

Many vestiges of the Roman period are still visible today, such as the Mausoleum of Lucius Munazio Planco located on Monte Orlando.
He was consul Roman, prefect of the Urbe, general of Julius Caesar (with whom he crossed the Rubicon River and in the Gallic campaigns), general of both Marcus Antony and of Octavian known as Augustus.

Middle Ages:

After the fall of the Western Roman Empire, Gaeta's history experienced a period of looting by both barbarians and by the Saracens but thanks to its position as a natural peninsula the city was fortified with walls walls on the top of the ancient medieval village arose the castle to defense of the town that gave shelter to the people from the surrounding areas who moved here for refuge and protection.

Naval force.

In the year 812 the first Gaetan fleet was born, when the Byzantine patrician
Gregory, governor of Sicily, under Arab threat, was forced to ask the duke of Naples and the other Campanian duchies for help.
Gregory's request was granted by Gaeta and Amalfi, which joined forces with Constantinople), defeated the Arab fleet off Lampedusa.

In the year 839, the Duchy of Gaeta won its independence, which lasted for more than two centuries.
These were years in which Gaeta had its military solidity, its political and jurisdictional autonomy, its civic legal institutions, considerable economic development through maritime trade and even its own currency, the "follaro."

From 839 to 1140 Gaeta can be considered in its own right a
maritime republic. Gaeta was part of the "Campanian League" which in the summer of 849 was the protagonist of the Battle of Ostia.The fleet consisted of the ships of the republics of: Naples, Sorrento, Amalfi and Gaeta, defeated the Saracens who were ready to invade and destroy Rome. Later in 915, there was another important war episode, the Duke of Gaeta John I contributed to the
establishment of the Christian League, which defeated the Saracens at the battle of the Garigliano.

The Duchy of Gaeta remained independent until the beginning of the 12th century, Gaeta lost its independence and was conquered by Roger II of Sicily of the Altavilla dynasty, who nonetheless left numerous privileges to the city, such as its own currency and significant political autonomy, and allowed it to retain its ancient and glorious character as a maritime republic just as in Amalfi.

Thus saw the light of a kingdom that lasted for the next seven centuries, a unitary, independent and sovereign kingdom, the only one in all of Europe to preserve its territorial limits in full for so long, with Gaeta serving on several occasions as the "de facto" capital and strategic border town with the Church State (except for the period of the Spanish viceroyalty 1504-1707 and the Austrian rule 1707-1734).

Under the rule of the dynasty of Swabian origin, Gaeta saw its function as a "key gateway" to the kingdom particularly strengthened. Frederick II of Swabia had fortifications created to better defend the borders: in 1223 he built those for Gaeta Castle.

The Aragonese royals, realized how strategically relevant the possession of Gaeta for the defense of the kingdom, and had the fortifications increased by adding two new city walls.

Gaeta suffered as many as 14 sieges, coinciding with important and crucial historical events, starting with the defeat of the Duchy of Gaeta (with annexation to the Kingdom of Sicily) to the last siege, decisive for the destinies of the Kingdom of the Two Sicilies, the one held in 1860-'61 by General Enrico Cialdini's troops and after which the proclamation of the Kingdom of Italy took place.

 

With the Spanish rule, Gaeta became a viceroyalty, Gaeta's role as a "stronghold" was accentuated; Charles V had bastioned fortifications built on the slopes of Mount Orlando, so that they could withstand the most powerful weapons firearms.

In the year 1571 the papal fleet assembled in the port of Gaeta, here under the command of Admiral Marcantonio Colonna, on June 24 it set sail to join the rest of the Christian fleet to fight the Saracens. The flagship of the papal fleet under the admiral's command had hoisted the Standard of Lepanto
which the same commander had received on June 20, 1571 from Pope St. Pius V.

The battle was won by the Christian forces, and on his return to Gaeta Admiral Marcantonio Colonna kept his oath (he would donate the banner in case of victory to the same
Cathedral by placing it at the feet of the saint) before the relics of St. Erasmus of Antioch, protector of sailors and patron of the city. Today the banner is displayed in the diocesan museum.

On Nov. 25, 1848, Pope Pius IX took refuge in Gaeta as the guest of King Ferdinand II of Bourbon and remained there until Sept. 4, 1849, a period during which which Gaeta was the institutional seat and "de facto" capital of the State of the Church.

On Nov. 25, 1848, Pope Pius IX took refuge in Gaeta, the guest of King Ferdinand II of Bourbon, and remained there until Sept. 4, 1849, a period during which Gaeta was the institutional seat and "de facto" capital of the Church State.

During this stay Pope Pius IX, enlightened by the Holy Spirit during his prayers at the Golden Chapel, decided to write the encyclical Ubi Primum with which he questioned the Catholic Episcopate on the advisability of proclaiming the Dogma of the Immaculate
Conception, which took place upon his return to Rome.

On February 13 February 1861 Francis II of Bourbon surrendered Gaeta, the last bastion of his kingdom, capitulating, after 102 days of bombardment, to the siege of the Savoy troops of General Enrico Cialdini (Siege of Gaeta 1860-1861): with the capitulation of Gaeta the Kingdom of the Two Sicilies ceased to exist.

The Borgo di Gaeta, a hamlet of Gaeta outside the walls, by Royal Decree of March 15, 1897, became an autonomous municipality and took the name "Comune di Elena" in honor of the then Princess Elena, future queen of Italy. Thirty years later, by Royal Decree of February 17, 1927, the municipalities of Gaeta and Elena were united again under the name Gaeta. The Borgo was identified as rione Porto Salvo, the fortified part of the city as rione Sant'Erasmo.

On 6 February 1927, Gaeta lost its ancient and famous status as a stronghold but became an important base of the Italian Navy, more specifically its port went on to constitute the main naval base in the Tyrrhenian Sea along with the port of La Spezia.

The city of Gaeta an important part of the ancient province of Terra di Lavoro of the Kingdom of Naples represented one of five district capitals. Within the Kingdom of Italy, the province was
maintained with the same name and capital and was subdivided, according to the Rattazzi law, into districts. Gaeta was a district capital until 1927 (along with Caserta, Sora, Nola and Piedimonte d'Alife).

When in 1927 the regime fascist regime reorganized Italy's administrative territorial ambits, it incorporated Gaeta into the province of Rome, then, in 1934, into the newly established province of Littoria, now the province of Latina.

Since 1970, with the establishment of regions with ordinary status, Gaeta has therefore been part of the Lazio region.