War of the Third Coalition
Riots, and a popular revolt at the winter palace Aranjuez, in 1808 forced the king to abdicate on 19 March, in favor of his son. Ferdinand took the throne as Ferdinand VII, but was mistrusted by Napoleon, who had 100,000 soldiers stationed in Spain by that time due to the ongoing War of the Third Coalition.