The history of Rioja wine reflects a long and varied winemaking tradition in the Spanish region of La Rioja, starting with the first Phoenician settlers in 11th century BC. As with many of Europe's best-known wine regions, the Ancient Romans founded many of the Rioja vineyards. Throughout the Middle Ages, pilgrims to the shrine of St. James at Santiago de Compostela passed through the region and carried back with them the reputation of wines from the area. The phylloxera epidemic of the late 19th century was a major catalyst in the expansion and modernization of the Rioja wine industry, with the devastation of the French wine industry both opening up the French wine market and bringing an influx of French investment into the region. Today, together with Sherry, Rioja is the most internationally recognized of all Spanish wines.
The earliest vine-growing people to reach the Rioja were the Phoenicians, who traveled up the Ebro river and left traces of settlements near Alfaro. The Rioja region was conquered by the Ancient Romans in the early 2nd century BC and probably came under Roman rule through treaties with the local Celtiberian and Vascon tribes. Vineyards were established at settlements near modern-day Calahorra and Logroño and bodegas soon sprang up in order to supply the Roman troops.
Archaeological exploration has uncovered evidence of a local cistern from that period with the capacity to hold 75,000 liters of wine. Wine historian Roger Dion has theorized that when the Romans settled in Bordeaux, some of the plant cuttings that they took with them may have originated in Rioja vineyards, in the form of an ancient vine Balisca, which may have been the ancestor of the Cabernet family, leading to the development of the classic varieties Cabernet Sauvignon, Cabernet franc, Merlot and Petit Verdot in the Médoc wine region.
Vineyards occupied the usual part of rural landscapes in medieval Rioja during the High Middle Ages (10th–13th century)  There are proofs of Rioja wine export towards other regions as early as the late 13th century, which testifies the beginnings of a commercial production.
From the 15th century on, the Rioja Alta specialized in wine growing. The popular pilgrimage route el Camino de Santiago took thousands of Christian pilgrims right through the heart of the Rioja throughout the Middle Ages, just as it does today. Whereas many visitors sampled the local wine and the reputation of the region became widespread, not many samples of the wines left the area.
Following the Reconquista, Rioja wine merchants began to look for outside markets for their wine. Looking north, some bodegas brought their wines to the trading ports of Bilbao and Santander where it became available to Dutch and English wine merchants. This developing trade with its Basque Country neighbors served as an impetus for the bodegas to expand their wine production. As the region's reputation grew, the local authorities tried to implement safeguards to protect the quality and reputation of the wine.
In 1560 the use of grapes from outside the Rioja region was prohibited and wine exported from the region had to transported in bota bags, branded with a seal to guarantee the authenticity of their contents.
In the 1780s, Don Manuel Quintano of nearby Burgos traveled to Bordeaux to learn their winemaking techniques. On his return, he introduced the use of Oak aging barrels to the Rioja bodegas, which dramatically improved the longevity of Rioja wines. This opened up their export potential, and markets soon developed in places as far-flung as Cuba and Mexico. Despite this success, the regional authorities dictated that the all Rioja wines, whether destined for foreign or domestic consumption, must be the same price, regardless of the added expense incurred by oak aging. This significant economic disadvantage caused the use of oak to fall out of favor for almost a century.
The Duke de la Victoria owned a bodega in Logroño and spent considerable time in London during a period of exile following the defeat of the Carlists. It was there that he and an aide, Colonel Luciano Murrieta, discussed ways in which to modernize the Rioja wine industry, with the aim of competing for the sizable British market. Murrieta was dispatched to Bordeaux to learn the latest advances in the Bordeaux wine industry, much like Quintano had been several decades before. One of the improvements Murrieta brought back was the utilization of large vats to crush and ferment the grapes, in place of the outdoor stone lagos in which grapes were traditionally crushed by the feet of the vineyard workers. Murrieta also reintroduced the use of oak for aging.
In the 1850s, the fungal disease powdery mildew began to ravage vineyards in nearby Galicia, opening up the market up for Rioja bodegas, which had been only slightly affected. The completion of a railway system linking Logroño to Bilbao, Madrid and Irun coincided with the onset of the phylloxera epidemic in Europe. The French were the first and hardest hit by the louse, which created an immediate and insatiable demand for all the wine the Rioja could produce. Amidst devastation in the French wine industry, dozens of négociant and French winemakers, mostly from Bordeaux, traveled to the Rioja to set up wineries, where they could continue to produce wine – bringing with them extensive knowledge, techniques and experience. This ushered in a period of unprecedented growth and prosperity for the Rioja wine industry.
The subsequent boom in the Rioja wine industry lasted until phylloxera finally reached the region itself in the 1890s. By then the cure of grafting American rootstock had been successfully employed in France and it was only a matter of time before the Spanish were able to replant their own vineyards with the new grafted vines. In the meantime, regional authorities stepped in to sharply curb all wine imports, so that the local wine supply would take priority. Laws were passed prohibiting the export of wines from any bodega producing less 750,000 liters of wine per annum.
At the turn of the 20th century, Rioja had established itself as the most recognizable name for Spanish wine outside of Spain. However the effects of World War I, the Spanish Civil War and World War II created trying times for the Rioja industry. Country-wide hunger resulted in government decrees stating that vineyards had to be torn up and replanted with wheat in order to feed the populace. It wasn't till the 1960s that many of these lands would be planted with vines once again. The 1970 vintage was a turning point for the Rioja wine industry, widely hailed as the "vintage of the century" and ranked by wine critics as one of the best of any region in the world. This success caused a surge in consumer interest in the wines, and with that an influx of foreign investment in the vineyards and bodegas of the Rioja.
In the 1980s, a steady stream of under-performing vintages and excessively high prices caused a significant drop in sales, while other Spanish wine regions like the Ribera del Duero began to emerge, capturing more international attention and sales. In response, modern Rioja winemakers began experimenting with more international styles of wine, younger, more powerful and deeply colored than the traditional Rioja. The heavy use of oak was restrained with the aim of releasing wines onto the market sooner, so that they could be enjoyed earlier. Sales began to improve and in 1991, Rioja was the first region to be awarded Denominación de Origen Calificada status, with which the Spanish recognised the Rioja as its premier wine region.