The Kingdom of Viguera (Basque: Viguerako Erresuma) was a small, short-lived kingdom centered on the town of Viguera from 970 to 1005. The kingdom was created by García Sánchez I, King of Pamplona for the eldest son of his second marriage, Ramiro Garcés, who became the first king of Viguera. The kingdom encompassed a territory roughly equivalent to present-day La Rioja. The kingdom went back to being part of Pamplona around the year 1005.
In the year 918 Ordoño II of León and Sancho I of Pamplona invaded Viguera to clear out the Banu Qasi dynasty from the land. By 923, the area had been subdued and fortified. From 924 and until the year 972 the land around Viguera was ruled by Fortún Galíndez, who had the title of Duke of Viguera.
García Sánchez I of Pamplona, left as heir to the Kingdom of Pamplona his first son by his first marriage, Sancho II. After the insistence of his second wife, Teresa of León, García I willed Viguera to his first son with her, Ramiro Garcés. After the death of García I, his son Sancho II, acting as King of Pamplona, recognised his half-brother's rights over Viguera. Ramiro was succeeded in the throne by his son, Sancho Ramírez in 991. Sancho's brother, García Ramírez acted as co-king prior to his brother's death in 1002 or shortly thereafter. García left only daughters and simply disappears from the historical record between 1005 and 1030. Later on Viguera appears again as being part of the Kingdom of Pamplona.