During the Napoleonic Wars, the city was occupied by French troops in 1808. General Pierre Dupont de l'Étang, after conquering Córdoba, established his HQ at Andújar. From Andújar Dupont sent troops to Bailén, where he lost the battle there. After this battle, the capitulations were signed at Andújar in the Palace of Gracia Real.