Most of France's actions in Algeria, not least the invasion of Algiers, were propelled by contradictory impulses. In the period between Napoleon's downfall in 1815 and the revolution of 1830, the restored French monarchy was in crisis, and the dey was weak politically, economically, and militarily. The French monarch sought to reverse his domestic unpopularity. As a result of what the French considered an insult to the French consul in Algiers by the dey in 1827, France blockaded Algiers for three years. France used the failure of the blockade as a reason for a military expedition against Algiers in 1830.