Marshal Murat led 120,000 troops into Spain. The French arrived in Madrid on 24 March, where wild riots against the occupation erupted just a few weeks later. Napoleon appointed his brother, Joseph Bonaparte, as the new King of Spain in the summer of 1808. The appointment enraged a heavily religious and conservative Spanish population. Resistance to French aggression soon spread throughout Spain. The shocking French defeats at the Battle of Bailén and the Battle of Vimiero gave hope to Napoleon's enemies and partly persuaded the French emperor to intervene in person.