Napoleonic client kingdom (officially 'Kingdom of the Spains and the Indies') installed after Napoleon forced the Spanish royal family's abdication at Bayonne and crowned his brother Joseph Bonaparte king; a semi-constitutional monarchy under the Bayonne Statute that never controlled more than the French-occupied core, resisted throughout by guerrilla warfare and Ferdinand VII-loyalist juntas -- the Peninsular War.
Defeated at the Battle of Vitoria (June 1813); Joseph abandoned Madrid and French forces withdrew from Spain, and the Treaty of Valencay (December 1813) recognized Ferdinand VII as the legitimate king, restoring the Bourbon monarchy in 1814.
Major modern scholarly history of the Peninsular War told substantially from the Spanish side (guerrilla resistance, juntas, civilian experience under Joseph's occupation) -- directly covers this record's span and character. Open-Library-verified (/works/OL4933542W).
Classic novel of an English rifleman operating behind French lines in Portugal/Spain during the Peninsular War -- fiction set squarely within this kingdom's span and conflict. Open-Library-verified (/works/OL1937757W).