PARIS (AP) — The gunman in the Paris kosher supermarket siege appeared Sunday in a posthumous video,pledging allegiance to the Islamic State group and explaining the planning and the reasoning behind the attacks that sowed terror across France.

Apparently filmed over several days and edited after the attacks, the video shows Amedy Coulibaly displaying a small arsenal of weapons, doing pushups and pullups in a drab courtyard and, in broken Arabic, giving fealty to IS militants. The video appeared Sunday on militant websites, and two men who dealt drugs with Coulibaly confirmed his identify to The Associated Press.

"My brothers, our team, divided things in two," he tells the camera in a close-up.

"We did things a bit together and a bit apart, so that it'd have more impact," he said in fluent French, adding that he had helped the brothers financially with "a few thousand euros" so they could finish with purchases for the operation.

The two men who methodically killed 12 people at the Charlie Hebdo offices, brothers Said and Cherif Kouachi, told survivors they were from al-Qaida in Yemen, and the terror group claimed responsibility for the attack. But the ties among the men date back to 2005, long before IS had come into being and well before Said Kouachi is believed to have traveled to Yemen.

Wearing a black jacket and cap, and seated calmly alongside an assault rifle and beneath an Islamic flag used by the extremist group, Coulibaly explained why the satirical newspaper Charlie Hebdo and the Jewish store were targeted.

"What we are doing is completely legitimate, given what they are doing," he said.

The weekly newspaper lampooned religions of all kinds, and Islam was a frequent target of its satire. Its offices were firebombed in 2011 after it reprinted caricatures of the Prophet Muhammad and its editor had a police bodyguard, who was the first to die.

After the massacre at Charlie Hebdo, the Kouachi brothers led police on a chase for two days and were then cornered Friday at a printing house near Charles de Gaulle Airport. Within hours, Coulibaly — who had by then already killed a policewoman and attacked a jogger — took over the kosher market in eastern Paris with hostages inside, threatening to kill them all unless police let the Kouachis go.

Coulibaly, who prosecutors said killed four people at the market, died when police stormed the building. That raid took place just minutes after security forces killed the Kouachi brothers.

All three attackers were French.

"We are going to have to determine the conditions in which this video was posted," said Bernard Petit, the head of the Paris judicial police, on France's TF1 TV.

About 400 police investigators are working nearly around the clock on the case, he said. "Obviously, we're going to be interested in any people who received and broadcast this video," he added.

After speaking in French in the video, Coulibaly continues in broken Arabic, stumbling over words he can't pronounce that he seems to be reading from a paper. He mangles grammar as he gives his allegiance to the head of the Islamic State group. He repeats a pact that other loyalists have used to pledge fealty to the militant group and then calls for others to carry out similar attacks.

The French ambassador to the U.S. said there are thousands of young Islamic radicals in Europe, stressing that authorities can't arrest people because of their ideas.

"We have, in France, hundreds of young people who came to Syria or who came to Yemen and were getting their military training," Gerard Araud told ABC's "This Week."

"We don't know when these people are coming back and whether they are coming back. And we don't know when ... these radical people are going suddenly to become terrorists," he said.

In Germany, arsonists early Sunday attacked a newspaper that republished Charlie Hebdo's cartoons, and two men were detained. No one was hurt in the fire, but the newspaper Hamburger Morgenpost said several files in its archives were destroyed.

Coulibaly's widow, who has been named as an accomplice, is believed to have traveled to a Turkish city near the Syrian border, and then all traces of her were lost, according to a Turkish intelligence official, who wasn't authorized to speak by name to reporters.

One fellow drug dealer from the Paris suburb of Bretigny said Coulibaly regularly sold marijuana and hashish to high school students, and as recently as a month ago, was still dealing dope. That man and another fellow drug dealer identified him as the man in the video released Sunday. They spoke on condition of anonymity to avoid problems with the police.

Five people with ties to the Kouachi brothers detained in connection with the attacks have been released, the Paris prosecutor's spokeswoman said Sunday. Family members of the attackers have been given preliminary charges, but prosecutor's spokeswoman Agnes Thibault-Lecuivre said no one remained in detention over the attacks that left France a changed country.


Associated Press writers Jamey Keaten, Raphael Satter and Trung Latieule in Paris; Diaa Hadid in Beirut; and Desmond Butler in Istanbul contributed to this report.

Copyright 2015 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.