The French invaded Algeria in 1830. Directed by Marshall Bugeaud, who became the first Governor-General of Algeria, the conquest was violent, marked by a "scorched earth" policy designed to reduce the power of the native rulers, the Dey, including massacres, mass rapes, and other atrocities.

In 1834, Algeria became a French military colony.

Algeria was subsequently declared by the constitution of 1848 to be an integral part of France and divided into three departments: Alger, Oran and Constantine. Many French and other Europeans (Spanish, Italians, Maltese, and others) later settled in Algeria.

Under the Second Empire (1852–1871), the Code de l'indigénat (Indigenous Code) was implemented by the Sénatus-consulte of July 14, 1865. It allowed Muslims to apply for full French citizenship, a measure that few took, since it involved renouncing the right to be governed by sharia law in personal matters and was considered a kind of apostasy.

Prior to 1870, fewer than 200 demands were registered by Muslims and 152 by Jewish Algerians. The 1865 decree was then modified by the 1870 Crémieux decrees, which granted French nationality to Jews living in one of the three Algerian departments.

In 1881, the Code de l'Indigénat made the discrimination official by creating specific penalties for indigènes and organizing the seizure or appropriation of their lands.

After World War II, equality of rights was proclaimed by the Ordonnance of March 7, 1944.

At first, and despite the Sétif massacre of May 8, 1945, and the pro-Independence struggle before World War II, most Algerians were in favor of a relative status-quo. While Messali Hadj had radicalized by forming the FLN, Ferhat Abbas maintained a more moderate, electoral strategy.

The Law of September 20, 1947, granted French citizenship to all Algerian subjects, who were not required to renounce their personal status.

In the early morning hours of November 1, 1954, FLN (the National Liberation Front) maquisards (guerrillas) attacked military and civilian targets throughout Algeria in what became known as the Toussaint Rouge (Red All-Saints' Day).

Effectively started by members of the National Liberation Front (FLN) on November 1, 1954, during the Toussaint Rouge ("Red All Saints' Day"), the conflict led to serious political crises in France, causing the fall of the Fourth French Republic (1946–58) replaced by the Fifth Republic with a strengthened Presidency.

By 1955, effective political action groups within the Algerian colonial community succeeded in convincing many of the Governors-General sent by Paris that the military was not the way to resolve the conflict. A major success was the conversion of Jacques Soustelle, who went to Algeria as governor-general in January 1955 determined to restore peace. Soustelle, a one-time leftist and by 1955 an ardent Gaullist, began an ambitious reform program (the Soustelle Plan) aimed at improving economic conditions among the population.

In March 1955, Rabah Bitat, head of the FLN in Algiers, was arrested by the French.

The FLN adopted tactics similar to those of nationalist groups in Asia, and the French did not realize the seriousness of the challenge they faced until 1955, when the FLN moved into urbanized areas. "An important watershed in the War of Independence was the massacre of Pieds-Noirs civilians by the FLN near the town of Philippeville (now known as Skikda) in August 1955. Before this operation, FLN policy was to attack only military and government-related targets. The commander of the Constantine wilaya/region, however, decided a drastic escalation was needed. The killing by the FLN and its supporters of 123 people, including 71 French,S including old women and babies, shocked Jacques Soustelle into calling for more repressive measures against the rebels.

In April 1956, Abbas flew to Cairo, where he formally joined the FLN. This action brought in many évolués who had supported the UDMA in the past.

On 19 June 1956 two FLN prisoners were executed by guillotine at the Barberousse Prison.

Abane Ramdane ordered immediate reprisals against the French and Yacef Saâdi, who had assumed command in Algiers following Bitat's arrest was ordered to "shoot down any European, from 18 to 54. No women, no children, no elder." A series of random attacks in the city followed with 49 civilians shot by the FLN between 21 and 24 June.

In August and September 1956, the leadership of the FLN guerrillas operating within Algeria (popularly known as "internals") met to organize a formal policy-making body to synchronize the movement's political and military activities. The highest authority of the FLN was vested in the thirty-four member National Council of the Algerian Revolution (Conseil National de la Révolution Algérienne, CNRA), within which the five-man Committee of Coordination and Enforcement (Comité de Coordination et d'Exécution, CCE) formed the executive.

On the night of 10 August 1956, helped by members of Robert Martel's Union française nord-africaine, Achiary planted a bomb at Thèbes Road in the Casbah targeted at the FLN responsible for the June shootings, the explosion killed 73 Algerian.

On the evening of 30 September 1956, a trio of female FLN militants recruited by Yacef Saâdi, Djamila Bouhired, Zohra Drif and Samia Lakhdari, carried out the first series of bomb attacks on three civilian targets in European Algiers. The bombs at the Milk Bar on Place Bugeaud and the Cafeteria on Rue Michelet killed 3 and injured 50, while the bomb at the Air France terminus failed to explode due to a faulty timer.

In October 1956, the French Air Force intercepted a Moroccan DC-3 bound for Tunis, carrying Ahmed Ben Bella, Mohammed Boudiaf, Mohamed Khider and Hocine Aït Ahmed, and forced it to land in Algiers. Lacoste had the FLN external political leaders arrested and imprisoned for the duration of the war. This action caused the remaining rebel leaders to harden their stance.

One organized pseudo-guerrilla unit, however, was created in December 1956 by the French DST domestic intelligence agency. The Organization of the French Algerian Resistance (ORAF), a group of counter-terrorists had as its mission to carry out false flag terrorist attacks with the aim of quashing any hopes of political compromise.

On 28 December 1956, on the orders of Ben M'hidi, Ali La Pointe assassinated the Mayor of Boufarik and President of the Federation of Mayors of Algeria, Amedee Froger outside his house on Rue Michelet. The following day, a bomb exploded in the cemetery where Froger was to be buried; enraged European civilians responded by carrying out random revenge attacks (ratonnade), killing four Muslims and injuring 50.

During 1957, support for the FLN weakened as the breach between the internals and externals widened. To halt the drift, the FLN expanded its executive committee to include Abbas, as well as imprisoned political leaders such as Ben Bella. It also convinced communist and Arab members of the United Nations (UN) to put diplomatic pressure on the French government to negotiate a cease-fire.

Late in 1957, General Raoul Salan, commanding the French Army in Algeria, instituted a system of quadrillage (surveillance using a grid pattern), dividing the country into sectors, each permanently garrisoned by troops responsible for suppressing rebel operations in their assigned territory. Salan's methods sharply reduced the instances of FLN terrorism but tied down a large number of troops in static defense. Salan also constructed a heavily patrolled system of barriers to limit infiltration from Tunisia and Morocco.

On 7 January 1957, Governor-General Robert Lacoste summoned General Salan and General Massu commander of the 10th Parachute Division (10e DP) and explained that, as the Algiers police force was incapable of dealing with the FLN and controlling the Pied-noirs, Massu was to be granted full responsibility for the maintenance of order in Algiers.

On the afternoon of Saturday 26 January, female FLN operatives again planted bombs in European Algiers, the targets were the Otomatic on Rue Michelet, the Cafeteria and the Coq-Hardi brasserie. The explosions killed 4 and wounded 50 and a Muslim was killed by Pied-Noirs in retaliation.

In late January the FLN called an 8-day general strike across Algeria commencing on Monday 28 January. The strike appeared to be a success with most Muslim shops remaining shuttered, workers failed to turn up and children didn't attend school. However Massu soon deployed his troops and used armored cars to pull the steel shutters off shops while army trucks rounded up workers and schoolchildren and forced them to attend their jobs and studies. Within a few days the strike had been broken.

The bombings however continued and in mid-February female FLN operatives planted bombs at the Municipal Stadium and the El-Biar Stadium in Algiers killing 10 and injuring 45. After visiting Algiers, a clearly shocked defense minister Maurice Bourgès-Maunoury told General Massu after the bombings: "We must finish these people off!".

On 9 February, paratroopers of the 2nd Parachute Chasseur Regiment (2e RCP) arrested a prominent young lawyer and FLN sympathiser Ali Boumendjel. After attempting suicide Boumendjel volunteered everything he knew, including his involvement in the murder of a European family.

While females had not previously been searched in Algiers; following the Coq Hardi explosion one of the waiters identified the bomber as a woman. Accordingly, female suspects were subsequently searched by metal detectors or physically, limiting the ability of the FLN to continue the bombing campaign from the Casbah. In February Bigeard's troops captured Yacef's bomb transporter, who under extreme interrogation gave the address of the bomb factory at 5 Impasse de la Grenade. On 19 February the 3e RPC raided the bomb factory finding 87 bombs, 70 kg of explosives, detonators and other material, Yacef's bomb-making organisation within the Casbah had been destroyed.

On 25 February Colonel Trinqier's intelligence sources located Ben M'hidi who was captured in his pyjamas by Paras at Rue Claude-Debussy.

By late March 1957 the FLN organisation within Algiers had been completely broken, with most of the FLN leadership killed or underground and no bombs went off in Algiers. The 10e DP were withdrawn from the city and redeployed to engage the FLN in the Kabylia. However Yacef set about rebuilding his organisation within Algiers.

On 6 March it was announced that Ben M'hidi had committed suicide by hanging himself with his shirt.

On 23 March following a meeting between Massu, Trinquier, Fossy-Francois and Aussaresses to discuss what was to be done with Ali Boumendjel, Aussaresses went to the prison where Boumendjel was being held and ordered that he be transferred to another building, in the process he was thrown from a 6th floor skybridge to his death.

In early May two paratroopers were shot in the street by the FLN, their comrades led by one of Trinquier's informers attacked a bath-house which was believed to be an FLN hideout, killing almost 80 Muslims.

The use of torture was not restricted to Muslims, French FLN sympathisers were also picked up and subjected to it. Maurice Audin a Communist university professor was arrested by the paras on 11 June on suspicion of harboring and aiding FLN operatives, Henri Alleg the Communist editor of Alger républicain was arrested by the Paras at Audin's apartment the following day and was told by Audin that he had been tortured, Audin was never seen again and it is believed that he either died while being interrogated or was summarily executed.

On 3 June Yacef's forces planted bombs in street lamps at bus stops in the centre of Algiers, the explosions killed eight and wounded 90, a mix of French and Muslims., the explosions killed eight and wounded 90, a mix of French and Muslims.

On 9 June a bomb exploded at the Casino on the outskirts of Algiers killing nine and injuring 85. Following the burial of the dead from the casino, the Pied-Noirs started a ratonnade that resulted in five ِAlgerians dead and more than 50 injured. As a result of this upturn in violence, the 10e DP was again deployed to Algiers.

In July informal negotiations took place between Yacef and Germaine Tillion to try to agree a deal whereby attacks on civilians would stop in return for the French ceasing to guillotine members of the FLN. During this period a number of FLN bombs were planted but with no civilian casualties.

On 26 August following intelligence gained by Colonel Godard's operatives, the 3e RPC raided a house in the Impasse Saint-Vincent where Yacef's new bomb-maker and deputy were believed to be hiding. After suffering several casualties trying to capture the two alive, both men were eventually killed.

On 23 September a courier for Yacef was arrested by Godard's men.

At 5am on 24 September the 1e REP commanded by Colonel Pierre Jeanpierre sealed off Rue Caton and raided Yacef's hideout at No. 3. Yacef and Zohra Drif hid in a wall cavity, but this was soon located by the French troops. Yacef threw a grenade at the French troops but they were eager to take him alive and he and Zohra Drif eventually surrendered. Across the street at No 4, Ali La Pointe escaped the French cordon and went to another safe-house in the Casbah.

On the evening of 8 October the 1e REP surrounded Ali La Pointe's hideout at 5 Rue de s Abderames. The paratroops laid charges to blow away the false partition behind which Ali and his comrades were hiding, unfortunately the explosion detonated a store of bombs destroying the house and several neighbouring buildings, killing Ali, his two comrades and 17 other Muslims in neighbouring houses.

The French Army shifted its tactics at the end of 1958 from dependence on quadrillage to the use of mobile forces deployed on massive search-and-destroy missions against FLN strongholds.

After his time as governor general, Soustelle returned to France to organize support for de Gaulle's return to power, while retaining close ties to the army and the pieds-noirs. By early 1958, he had organized a coup d'état, bringing together dissident army officers and pieds-noirs with sympathetic Gaullists. An army junta under General Massu seized power in Algiers on the night of May 13, thereafter known as the May 1958 crisis.

On May 24, French paratroopers from the Algerian corps landed on Corsica, taking the French island in a bloodless action, Opération Corse.

On his June 4 trip to Algeria, de Gaulle calculatedly made an ambiguous and broad emotional appeal to all the inhabitants, declaring, "Je vous ai compris" ("I have understood you").

De Gaulle immediately appointed a committee to draft a new constitution for France's Fifth Republic, which would be declared early the next year, with which Algeria would be associated but of which it would not form an integral part. All Algerians, including women, were registered for the first time on electoral rolls to participate in a referendum to be held on the new constitution in September 1958.

De Gaulle visited Constantine in October to announce a program to end the war and create an Algeria closely linked to France. De Gaulle's call on the rebel leaders to end hostilities and to participate in elections was met with adamant refusal. "The problem of a cease-fire in Algeria is not simply a military problem", said the GPRA's Abbas. "It is essentially political, and negotiation must cover the whole question of Algeria." Secret discussions that had been underway were broken off.

In 1959, Salan's successor, General Maurice Challe, appeared to have suppressed major rebel resistance, but political developments had already overtaken the French Army's successes.

In February 1959, De Gaulle was elected president of the new Fifth Republic.

After major demonstrations in Algiers and several other cities in favor of independence (1960) and a United Nations resolution recognizing the right to independence.

In Paris on January 29, 1960, De Gaulle called on his ineffective army to remain loyal and rallied popular support for his Algerian policy in a televised address.

Most of the Army heeded De Gaulle's call, and the siege of Algiers ended on February 1 with Lagaillarde surrendering to General Challe's command of the French Army in Algeria.

The loss of many ultra leaders who were imprisoned or transferred to other areas did not deter the French Algeria militants. Sent to prison in Paris and then paroled, Lagaillarde fled to Spain. There, with another French army officer, Raoul Salan, who had entered clandestinely, and with Jean-Jacques Susini, he created the Organisation armée secrète (Secret Army Organization, OAS) on December 3, 1960, with the purpose of continuing the fight for French Algeria. Highly organized and well-armed, the OAS stepped up its terrorist activities, which were directed against both Algerians and pro-government French citizens, as the move toward negotiated settlement of the war and self-determination gained momentum.

To pressure de Gaulle to abandon his demand to keep the Sahara, the FLN organized demonstrations in France from Algerians living there in the fall of 1961, which the French police crushed.

De Gaulle convoked the first referendum on the self-determination of Algeria on January 8, 1961, which 75% of the voters (both in France and Algeria) approved and de Gaulle's government began secret peace negotiations with the FLN. In the Algerian départements 69.51% voted in favor of self-determination.

The talks that began in March 1961 broke down when de Gaulle insisted on including the much smaller Mouvement national algérien (MNA), which the FLN objected to. Since the FLN was the by far stronger movement with the MNA almost wiped out by this time, the French were finally forced to exclude the MNA from the talks after the FLN walked out for a time.

Talks with the FLN reopened at Évian in May 1961; after several false starts, the French government decreed that a ceasefire would take effect on March 18, 1962.

On 29 June 1961, De Gaulle announced on TV that fighting was "virtually finished" and afterward there was no major fighting between the French Army and the FLN; during the summer of 1961 the OAS and the FLN engaged in a civil war, in which the greater number of the ِAlgerians soon made a difference.

It was in the course of crushing one demonstration that a massacre of Algerians on 17 October 1961, which was ordered by Maurice Papon, took place.

In the spring of 1962, the OAS turned to bank robbery to finance its war against both the FLN and the French state, and bombed special units sent by Paris to hunt them down.

On 10 January 1962, the FLN started a "general offensive" against the OAS, staging a series on the pied-noir communities as a way of applying pressure.

On 7 February 1962, the OAS attempted to assassinate the Culture Minister André Malraux by setting off a bomb in his apartment building that failed to kill its intended target, but did leave a four-year girl living in the adjoining apartment blinded by the shrapnel.

On 20 February 1962 a peace accord was reached for granting independence to all of Algeria.

Charles de Gaulle, the first President of the Fifth Republic, decided to open a series of negotiations with the FLN. These concluded with the signing of the Évian Accords in March 1962. A referendum took place on 8 April 1962 and the French electorate approved the Évian Accords.

In the second referendum on the independence of Algeria, held in April 1962, 91 percent of the French electorate approved the Evian Accords.

The declaration of independence on July 5, 1962, the last French forces did not leave the naval base of Mers El Kébir until 1967.

Algeria was admitted as the 109th member of the United Nations on October 8, 1962.