The invasion of Algiers was a large-scale military operation by which the Kingdom of France, ruled by Charles X, invaded and conquered the Regency of Algiers. A diplomatic incident in 1827, the so-called Fan Affair (Fly Whisk Incident), served as a pretext to initiate a blockade against the port of Algiers. After three years of standstill and a more severe incident in which a French ship carrying an ambassador to the dey with a proposal for negotiations was fired upon, the French determined that more forceful action was required. Charles X also sought to divert attention from turbulent French domestic affairs which culminated with his deposition during the later stages of the invasion in the July Revolution.
The invasion began on 5 July 1830 with a naval bombardment by a fleet under Admiral Duperré and a landing by troops under Louis Auguste Victor de Ghaisne, comte de Bourmont. The French quickly defeated the troops of Hussein Dey, the Deylikal ruler, but native resistance was widespread. This resulted in a protracted military campaign, ultimately lasting more than 45 years, to root out popular opposition to the colonization. The so-called "pacification" was marked by resistance from figures such as Ahmed Bey, Emir Abdelkader, and Lalla Fatma N'Soumer. The invasion marked the end of the centuries-old Regency of Algiers and the beginning of the colonial period of French Algeria. In 1848, the territories conquered around Algiers were organised into three départements, defining the territories of modern Algeria.