The gunman in the Paris kosher supermarket siege appeared Sunday in a posthumous video, pledging allegiance to the Islamic State of Iraq and Syria (ISIS) 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 ISIS 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-Qaeda in Yemen, and the terror group claimed responsibility for the attack. But the ties among the men date back to 2005, long before ISIS had come into being and well before Said Kouachi is believed to have travelled to Yemen.

Charlie Hebdo, Jewish store targeted

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.

Authorities investigating video

"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.

France Attacks

This image from a video posted online by militants on Jan. 11 shows slain hostage-taker Amedy Coulibaly in front of an Islamic State emblem, as he defends the attacks carried out on the satirical newspaper Charlie Hebdo and a Jewish shop. (Associated Press)

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 on the run

Coulibaly's widow, who has been named as an accomplice, is believed to have travelled 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.

France Market Attack

Hayet Boumddiene, who has been named as an accomplice in the Paris attacks, is believed to have travelled to a Turkish city near the Syrian border. (Prefecture de Police de Paris/Associated Press)

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.

SITE Intelligence Group reported late Sunday that Moktar Belmoktar, the head of the Mourabitoune group that split from al-Qaeda's north Africa wing, had expressed praise in online jihadist forums for the Charlie Hebdo attack.

Aymenn al-Tamimi, a Britain-based expert on militant groups in Iraq and Syria, suggested the claims of loyalty to the rival jihadist groups aimed to stir up fears of militants uniting to fight the West.

Al-Qaeda in Yemen may reject the ISIS's declared caliphate, he said, "but they have stressed the necessity of supporting each other against the common enemy — which is, of course, the West."

Perhaps, al-Tamimi said, it was "to play on a bigger fear that the West has: that al-Qaeda and the ISIS would come together for an attack," he added.