An armed man took hostages in a supermarket in southern France, killing three people and injuring about a dozen others before being shot dead when French police stormed the market, authorities have said.

French President Emmanuel Macron said all evidence suggested that it was a terror attack – the first one since he became president in May.

It is unclear how many victims there are overall, said Yves Lefebvre, secretary general of the SGP Police-FO police union.

The attacker first fired six shots at police officers on their way back from jogging near the city of Carcassonne on Friday morning, said Mr Lefebvre.

The police were not in uniform but were wearing athletic clothes with police insignia.

One police officer was shot in the shoulder but the injury was not serious, Mr Lefebvre said.

Graphic locates Trebes in southern France where a gunman is holding several people hostage
(PA graphic)

The suspect then went to a Super U supermarket in the nearby small town of Trebes, 60 miles south east of Toulouse, taking an unknown number of people hostage.

In an hours-long standoff, special police units converged on the scene and authorities blocked roads and urged residents to stay away.

Police then stormed the supermarket.

Interior minister Gerard Collomb confirmed that the attacker had been shot dead and three other people were killed.

Mr Collomb went to Trebes after talking with Mr Macron, who was at an EU summit in Brussels.

The Paris prosecutor’s office said counter-terrorism investigators were taking over the probe but did not explain why.

Police attend the incident in Trebes (La Depeche Du Midi via AP)
Police attend the incident in Trebes (La Depeche Du Midi via AP)

Unconfirmed media reports said the assailant claimed connections to Islamic State.

Mr Collomb identified the suspect as Redouane Lakdim, 26, a petty criminal and small-time drug dealer who he said was radicalised and under police surveillance.

The minister said that during the standoff Lakdim requested the release of the sole surviving assailant of the November 13 2015 attacks in Paris that left 130 people dead.

France has been on high alert since a string of Islamic extremist attacks in 2015 and 2016 that killed more than 200 people.

The shootings occurred in a normally quiet part of France, where the main tourist attraction is the treasured old city of Carcassonne, its medieval walls and its summertime festivals.

A police vehicle parked on a crossroad in Trebes (BFM TV via AP)
A police vehicle parked on a crossroad in Trebes (BFM TV via AP)

Mr Macron said he will be back in Paris within hours.

The attack poses a new challenge to his leadership as he also faces nationwide strikes and criticism of his reforms.

Standing next to Mr Macron, German Chancellor Angela Merkel expressed her sympathy with those affected by the hostage-taking.

“When it comes to terrorist threats, we stand by France,” she said.