French authorities launched a massive dragnet this week following the massacre at the satirical newspaper Charlie Hebdo. Here are the key moments so far. (Jorge Ribas/The Washington Post)

Deploying stun grenades and assault rifles, French police staged nearly simultaneous operations to end two bloody standoffs Friday, capping three days of carnage that plunged France into a state of siege and heightened fears across Europe over the resurgent threat of homegrown terror.

The fast-moving events on Friday that left four hostages dead underscored the complex, even haphazard web of allegiances that constitute locally bred terrorism, with three men apparently working together yet claiming loyalties to two rival organizations based in the Middle East — al-Qaeda in Yemen and the Islamic State. In a bizarre twist, the assailants offered brief if telling interviews before going to their deaths, placidly discussing their motivations, funders and acts of violence.

The dramatic police actions Friday began in the ancient town of Dammartin-en-Goele, where the two brothers who touched off the crisis Wednesday in a bloody rampage on the offices of a satirical newspaper were holed up in a printing plant. As night fell, they emerged from a crack in the door of the plant, guns blazing in an apparent death pact. Police responded with stun grenades, before they took the men down, still firing as they fell to the ground.

Twenty-six miles south, a third man, who claimed to be working in coordination with the brothers and was suspected of gunning down a police officer on Thursday, brought terror to a corner of multicultural east Paris on Friday. He sprayed a kosher grocery with bullets, killing four, before taking 16 hostages. The man, Amedy Coulibaly, 32, a French citizen of Senegalese descent, later died in the police raid to free the hostages, staged only minutes after the confrontation ended with the brothers, Said Kouachi, 34, and Chérif Kouachi, 32. A fourth suspect — Coulibaly’s female companion — remained at large.

The crises deeply shocked the nation, exposed gaping holes in state security and heightened the ethnic, religious and political tensions that, particularly in recent years, have festered in the French republic. The brothers, in particular, were well known to French intelligence agencies, raising serious questions about how they could have fallen off the national radar so completely.

“There was a failing, of course,” French Prime Minister Manuel Valls said on BFM television late Friday. “When 17 people are killed, this means there was a failing,” he added, citing the three-day death toll.

Speaking during an event in Tennessee on Friday, President Obama offered his condolences to the French people following this week’s terror attacks in and around Paris.

“We grieve with you, we fight alongside you to uphold our values, the values that we share, the universal values that bind us together as friends and as allies,” Obama said.

Obama said that after Friday’s raids he was hopeful that the “immediate threat” had been resolved. He said after Wednesday’s attack on satirical newspaper Charlie Hebdo that he directed U.S. law enforcement and counterintelligence officials to assist the French government.

“I think it’s important for us to understand, France is our oldest ally,” Obama said. “We want the people of France to know the United States stands with you today, stands with you tomorrow. Our thoughts and prayers are with the families that have been affected. . . .

“The streets of Paris and the world see again what the terrorist stands for: suffering,” Obama continued. “We stand for freedom and hope and dignity for all human beings. That spirit will endure forever, long after the scourge of terrorism is banished from this world.”

The barrage of violence sparked an outpouring of emotion across Europe, even as it raised fears of emboldening anti-immigrant, far-right movements that have made powerful and recent gains. The leaders of Germany, Britain, France and Italy announced plans to convene in Paris on Sunday, partaking in a vigil meant to celebrate French unity and the lives of the fallen, and especially the irreverent cartoonists at Charlie Hebdo.

Tensions have already been mounting in France as an estimated 1,200 of its citizens have left their homes to join Islamist militants fighting in Syria and in Iraq. At the same time, France has emerged as a leader in the effort to counter the rise of Islamist militants, sending troops to Africa and joining the United States in bombing runs against the Islamic State group in Iraq.

The terror dredged up long-known stresses in French society, including the lingering problems of disadvantaged young Muslims living in hives of apartments in the poor Paris suburbs. Yet President François Hollande, addressing the nation Friday, appealed to his citizens that they not see the violence this week as the product of Islam, but rather as the acts of “fanatics” that “have nothing to do with the Muslim religion.”

He also seemed to prepare the nation for a new era of uncertainty. “France is not finished with this threat,” he said.

The day’s violence started around 8:30 a.m. when shots were reported near Paris’s Charles de Gaulle Airport. The prosecutor in charge of the investigation, François Molins, said the stolen gray Renault Clio the Kouachi brothers had been driving got stuck in a ditch, forcing them to carjack a Peugeot 206, in which they stumbled upon a police patrol. Officers engaged the men in the town of Dammartin-en-Goele, and Said Kouachi was grazed in the neck. On foot, the brothers — two French-born orphans of Algerian descent, one an occasional pizza deliveryman, the other a long pious zealot — sought refuge in the CTD Printing Plant, situated in an industrial enclave.

The men initially took one hostage before letting him go, claiming they were not interested in killing “civilians.” During the eight-hour standoff, one employee hid under a sink in the plant’s kitchen, going undetected by the brothers and offering police details on their whereabouts via cellphone.

SWAT teams attempted negotiations by leaving voice mails on their cell numbers, to which the men never replied. At 4:56 p.m., the brothers emerged, making their last stand.

In Paris, meanwhile, a separate but linked hostage situation began unfolding around 1 p.m. The target: a kosher grocery store in eastern Paris, bustling in the hours ahead of the start of the Jewish Sabbath. Amedy Coulibaly, an associate the Kouachi brothers had met in prison, entered the store and started shooting an assault rifle, killing four people before quickly taking hostages. Police officials said that his demand was simple: If police stormed the Kouachi brothers, he would kill his captives.

Shortly after 5 p.m., police raided the grocery. Six quick explosions could be heard along with the sound of gunfire. Coulibaly was dead; the hostages secured. After authorities entered the grocery, they found Coulibaly had rigged the place with explosives.

Before they were killed, the three men said Friday that they had ties to Islamist militants in the Middle East. Authorities drew multiple connections between the men. French security authorities said that the Kouachi brothers and Coulibaly had all been part of the Buttes Chaumont network, named after the Paris park where the group did its exercises. Cellphone records showed their wives had been in regular contact.

Chérif Kouachi told BFM TV on Friday morning that he and his brother had been sent by al-
Qaeda’s Arabian Peninsula affiliate and that he had met the group’s leader, Anwar al-Awlaki, in Yemen before Awlaki’s 2011 death. He directly stated that the leader had helped finance the brothers, who were heavily armed with assault rifles and a rocket-propelled grenade launcher.

U.S. authorities said Thursday that Said Kouachi had visited Yemen. BFM TV said that it had reached Kouachi at the printing plant Friday morning when it called the building’s phone number hoping to find a witness to the attack. Chérif Kouachi simply picked up the phone. On Friday, a member of al-Qaeda’s branch in Yemen asserted responsibility for Wednesday’s attack against Charlie Hebdo that launched the crisis, calling it “revenge” for the paper’s satirical images lampooning Islam and the prophet Muhammad, according to the Associated Press.

The French newspaper Le Monde on Friday released what it said were Coulibaly’s personal photos showing him on an apparent trip to central France. The newspaper said he was visiting Djamel Beghal, a militant Islamist who spent time in prison connected to an attempt to blow up the U.S. Embassy in Paris and was later freed.

A woman wearing a full-face veil known as a niqab, whom Le Monde identified as Hayat Boumeddiene, Coulibaly’s companion, was also visible in the photos. Both the woman and Coulibaly were shooting crossbows. French authorities said Friday that Beghal, who had ties to al-Qaeda, had been a mentor to Coulibaly. Beghal was also friendly with Chérif Kouachi. Authorities said both Kouachi and Coulibaly had been recruited while in prison with Beghal in 2005.

On Friday afternoon, Coulibaly also spoke to BFM TV, calling the station in an apparent effort to reach police. In that conversation, Coulibaly, who is said to have killed a police officer on Thursday, sounded almost casual. He had closely coordinated the attacks with the Kouachi brothers. But he also said that he had been sent by “Daesh,” another name for the Islamic State, which has clashed with al-Qaeda. The reason for the discrepancy was not immediately clear, and by day’s end, all three suspects were dead.

“We coordinated from the beginning,” Coulibaly said.

The attack on the offices of satirical French newspaper Charlie Hebdo is the deadliest in recent history. Here are some of the major terror attacks in France in the last two decades. (Davin Coburn and Jorge Ribas/The Washington Post)

Birnbaum reported from Paris. Virgile Demoustier in Paris contributed to this report.