Algeria supporters wearing the country's national flag celebrate on the Champs-Elysee in Paris on July 14 after Algeria won the Africa Cup of Nations semifinal soccer match against Nigeria. (Zakaria Abdelkafi/AFP/Getty Images)

As Algeria and Senegal face off in the Africa Cup of Nations soccer final Friday, France — their former colonial power — is bracing itself for celebrations, far-right backlash and renewed debate over what, exactly, it means to be French or Algerian.

The far right in France has seized upon raucous celebrations by Algeria fans in Paris and other French cities after recent victories to dial up its anti-immigrant rhetoric, tapping into deep-seated tensions over national identity and the fractious post-colonial relationship between France and Algeria.

The success of Algeria and Senegal in this iteration of the Africa Cup has energized fans in both countries and among their diaspora communities across the world. Algeria bested Nigeria, 2-1, to advance to the final, while Senegal beat Tunisia, 1-0, in a nail-biting overtime win Sunday.

Much is on the line for both countries: For Senegal, Friday’s game could deliver the country its first-ever tournament win. For Algeria, it could mean a national victory at a time of political discord.

Both are former French colonies, but Algeria’s soccer team and the expressions of Algerian pride that have greeted it have emerged as particular flash points in France during this Africa Cup.

France colonized Algeria for 132 years until Algeria won a bloody war of independence in 1962. Waves of Algerians have immigrated to France before and since then.

Getting an accurate number for people of Algerian descent living in France is difficult, since French law prohibits the collection of demographic data on race and ethnicity. The French interior ministry estimated in 2008 that more than 1.5 million Algerian nationals or people of Algerian origin lived in France at that point, but some researchers have more recently put that figure at closer to 4 to 5 million.

For Algerians or their descendants in France, the Africa Cup has provided an opportunity to revel in their heritage. Supporters of the Algerian soccer team have taken to the streets of Paris and other French cities en masse after recent tournament victories in celebrations that have sometimes turned violent.

After Algeria’s semifinal victory, fans poured onto the Champs-Elysees in Paris in the early hours of Monday morning, standing atop parked cars, cheering and waving Algeria’s green, white and red flag. Similar celebrations took place in Marseille and Lyon.

But expressions of exuberant soccer fandom took a turn when some began throwing fireworks and projectiles and setting fire to trash cans, France 24 reported. Riot police confronted crowds in front of the Arc de Triomphe, and French authorities ultimately arrested 282 people across the country.

The clashes followed a similar wave of celebrations and arrests last week after Algeria’s quarterfinal win over Ivory Coast.

The National Rally, the far-right party led by Marine Le Pen, has capitalized on the arrests to decry Algerian soccer fans in France as anti-French and dangerous.

“Far from being only manifestations of joy of simple football amateurs as the majority of commentators have described, they are real demonstrations of force in which the objective is to ostensibly signify a massive presence and a rejection of France,” the party wrote in a statement last week.

Even though many Algeria fans in France are French or dual nationals, far-right politician Nicolas Dupont-Aignan said on French television Friday that Algeria supporters should “return to Algeria” — echoing a racist frame that President Trump recently used against four minority U.S. congresswomen, generating outcry in the United States.

“France hosted you, fed you, educated you, cared for you. But if you prefer Algeria, if Algeria is better than France, return to Algeria,” Dupont-Aignan said.

Algerians and French nationals of Algerian descent reacted angrily to his remarks on Twitter, pointing out that Algerian immigrants living in France pay taxes to the French government to fund state programs, and many supporters of the Algerian soccer team were born in France.

Competing expressions of national identity became particularly apparent the night of July 14, when the Africa Cup semifinal coincided with Bastille Day, France’s national holiday. Celebrations of Algeria’s soccer win took place on the same streets, lined with France’s tricolor flag, where the French military had paraded with pomp and tanks just hours earlier.

Ahead of the July 14 match, the National Rally called on Christophe Castaner, the French interior minister, to ban the Algerian flag and close down the Champs-Elysees. He declined to do so, although Parisian authorities did ramp up police presence in the capital that night.

Paris Police Chief Didier Lallement announced Wednesday that he would deploy 2,500 officers and gendarmes — the same number as Sunday — in anticipation of the aftermath of Friday’s match, French newspaper Le Parisien reported.

Meanwhile, Algeria Coach Djamel Belmadi appealed to fans to “respect the countries where we are living” ahead of Friday’s match in Cairo, according to France 24.

The soccer field has long functioned as a site of consternation over national identity in France and Algeria. Players of Algerian descent or nationality often don blue to play for the French national team, while some born in France have opted to join Algeria’s team instead. The cross-pollinating reflects the intermingling of cultures and backgrounds that have shaped both countries since the colonial era.

Zinedine Zidane — perhaps France’s most famous soccer player in recent history — was born to Algerian immigrants in Marseille. A majority of France’s winning World Cup team last year were immigrants — a fact commentators pointed to as a sign that a cosmopolitan French identity had prevailed.

Algeria, in turn, has often filled its roster with dual nationals. Algerian captain Riyad Mahrez, whose goal Sunday catapulted the team to the final, was born in France.

When a local National Rally politician in Burgundy suggested on Twitter that French people support Nigeria over Algeria in the semifinal to avoid “violence and pillaging” and “the tide of Algerian flags,” Mahrez offered a cheeky rebuke.

“The free kick was for you. We are together,” he wrote alongside smiley faces and symbols of the French and Algerian flags.

Correction: An earlier version of this article incorrectly translated a quote by Riyad Mahrez as saying “The French Cup was for you.” It has been corrected.