The city was originally founded as Gadir by the Phoenicians, who used it in their trade with Tartessos, a city-state believed by archaeologists to be somewhere near the mouth of the Guadalquivir River, about thirty kilometres northwest of Cádiz.
Cádiz is the most ancient city still standing in Western Europe. Traditionally, its founding is dated to 1104 BC although no archaeological strata on the site can be dated earlier than the ninth century. One resolution for this discrepancy has been to assume that Gadir was merely a small seasonal trading post in its earliest days.
Later, the Greeks knew the city as Gadira or Gadeira. According to Greek legend, Gadir was founded by Hercules after performing his fabled tenth labor, the slaying of Geryon, a monstrous warrior-titan with three heads and three torsos joined to a single pair of legs. As late as the early third century, a tumulus (a large earthen mound) near Cádiz was associated with Geryon's final resting-place.
One of the city's notable features during antiquity was the temple dedicated to the Phoenician god Melqart. According to the Life of Apollonius of Tyana, the temple was still standing during the first century AD. Some historians, based in part on this source, believe that the columns of this temple were the origin of the myth of the pillars of Hercules.
Around 500 BC, the city fell under the sway of Carthage. Cádiz became a base of operations for Hannibal's conquest of southern Iberia. However, in 206 BC, the city fell to Roman forces under Scipio Africanus. The people of Cádiz welcomed the victors. Under the Romans, the city's Greek name was modified to Gades; it flourished as a Roman naval base. By the time of Augustus, Cádiz was home to more than five hundred equites, a concentration of notable citizens rivaled only by Padua and Rome itself. It was the principal city of a Roman colony, Augusta Urbs Julia Gaditana. However, with the decline of the Roman Empire, Gades's commercial importance began to fade.
The fifth century overthrow of Roman power in Hispania Baetica by the Visigoths saw the destruction of the original city, of which there remain few remnants today. Under Moorish rule between 711 and 1262, the city was called Qādis , from which the modern Spanish name, Cádiz, was derived. The Moors were finally ousted by Alphonso X of Castile in 1262.
During the Age of Exploration, the city experienced a renaissance. Christopher Columbus sailed from Cádiz on his second and fourth voyages, and the city later became the home port of the Spanish treasure fleet. Consequently, the city became a major target of Spain's enemies. The sixteenth century also saw a series of failed raids by Barbary corsairs. The greater part of the old town was consumed in the conflagration of 1569. In April 1587 a raid by the Englishman Sir Francis Drake occupied the harbour for three days, capturing six ships and destroying 31 others as well as a large quantity of stores . The attack delayed the sailing of the Spanish Armada by a year.
The city suffered another raid in 1596 by the Earl of Essex and Lord Charles Howard, who sacked part of the town but were unable to hold the city and port. Yet another unsuccessful English raid was launched by the Duke of Buckingham in 1625 against the city, commanded by Sir Edward Cecil. In the Anglo-Spanish War Admiral Robert Blake blockaded Cádiz from 1655 to 1657. In the Battle of Cádiz (1702), the English attacked again under Sir George Rooke and James, Duke of Ormonde, but they were repelled after a costly siege.
In the eighteenth century, the sand bars of the river Guadalquivir forced the Spanish government to transfer the port monopolizing trade with Spanish America from upriver Seville to Cádiz with better access to the Atlantic. During this time, the city experienced a golden age during which three-quarters of all Spanish trade was with the Americas. It became one of Spain's greatest and most cosmopolitan cities and home to trading communities from many countries, among whom the richest was the Irish community. Many of today's historic buildings in the Old City date from this era.
By the end of the century, however, the city suffered another series of attacks. The British blockade and siege of Cádiz between February 1797 and April 1798 was, by most standards, a costly failure. Nelson, returning from his defeat at Santa Cruz, bombarded the city in 1800. During Napoleon's conquest of Europe, Cádiz was one of the few cities in Spain that was able to resist the French invasion.
The success of the Irish merchant community in late eighteenth-century Cádiz was due mainly to their engagement in the colonial trade. Small in number compared to other immigrant groups, they played a disproportionately prominent role in civic and ecclesiastical life, and as patrons of the arts in their adopted city. Their success stories in Cádiz contrast starkly with the lack of opportunity available to them in Ireland. Nevertheless, they did maintain vigorous mercantile and dynastic connections with their homeland. Their accomplishments were all the more remarkable in that they were achieved against a background of fierce competition in Europe's most dynamic entrepôt of the day.It is a connection that continutes to this day.
Cádiz was also the seat of the liberal Cortes that fought against Joseph Bonaparte in the Peninsular War; at Cadiz the liberal Spanish Constitution of 1812 was proclaimed. The citizens revolted in 1820 to secure a renewal of this constitution; the revolution spread across Spain, leading to the imprisonment of King Ferdinand VII in the city of Cádiz. French forces secured the release of Ferdinand in the Battle of Trocadero (1823) and suppressed liberalism. In 1868, Cádiz was once again the seat of a revolution, resulting in the eventual abdication and exile of Queen Isabella II. The same Cádiz Cortes decided to reinstate the monarchy under King Amadeo I just two years later. In recent years, the city has undergone much reconstruction. Many monuments, cathedrals, and landmarks have been cleaned and restored, adding to the considerable charm of this ancient city.