A gunman who had beaten and threatened his wife in southern France killed three policemen who came to the woman's aid and then fled, prompting a major manhunt until the suspected assailant was found dead.

The killing of three officers on duty drew national concern on Wednesday, notably from French leaders who are under pressure from police to do more to protect them.

President Emmanuel Macron tweeted: "They are our heroes."

A woman called for police help after threats by her husband at their home in a mountainous area near the town of Saint-Just, south west of Lyon, a spokesman for the gendarme service told the Associated Press.

After a lengthy standoff, three officers were killed and another injured, and the gunman fled, the spokesman said.

French media reported that the woman sought refuge from her armed husband on the roof of the home, and that the man later set the house on fire.

Some 300 police were sent to the area to search for the gunman, and he was found dead in circumstances that remain unclear, the spokesman said. The woman was taken into police care.

The Interior Ministry said 146 women were killed by their partners last year, which prompted a nationwide campaign against domestic violence.

Interior minister Gerald Darmanin went to the scene of the Saint-Just incident on Wednesday and praised the police actions.

Even as police are seeking greater protection, activists are increasingly speaking out about brutality by some officers, notably against minorities in low-income neighbourhoods.

In one recent case, four officers were charged over the violent beating of a black music producer that was caught on camera in images that shocked the French public. Two were held in custody but were released this week pending further investigation.

The producer, Michel Zecler, said on Wednesday that the officers are being "coddled" instead of punished. Speaking on BFM television, he said: "I can't understand what prompts such benevolence from the state."