A bus driver in France who was beaten up by passengers refusing to wear mandatory face masks died in hospital Friday, French Prime Minister Jean Castex and the victim's family have said.

Philippe Monguillot, 59, was left brain dead after the attack in the southwestern city of Bayonne on July 5. His family decided to switch off his life support on Friday, news agency Agence France-Presse reported.

"We decided to let him go. The doctors were in favour and we were as well," the victim's 18-year-old daughter, Marie Monguillot, told AFP.

Four men were detained and charged following the assault.

The attack occurred on Sunday around 7:15 p.m. on the 810 bus travelling to Biarritz after the bus driver checked the ticket of one of the men and asked all four to wear face masks, which are compulsory in French public transport, according to the public prosecutor's office.

On Wednesday, Monguillot's family organized a march in his honour, with all attendees wearing white.

Prime Minister Castex confirmed Monguillot's death on Twitter late Friday, writing that the case had "touched our hearts."

"The Republic recognizes him as an exemplary citizen and won't forget him. The law will punish the perpetrators of this despicable crime," he wrote, describing the attack as "cowardly."

French Interior Minister Gérald Darmanin also expressed his condolences to Monguillot's frends, family and colleagues.

"This heinous and cowardly act must not go unpunished. I'll be travelling to Bayonne tomorrow to make a point of safety in the city with state officials and meet with public transport drivers and unions," he wrote on Twitter.

The company Monguillot worked for, Keoilis, has boosted security for its employees, deploying guards on some of its bus services in the area.

The company held a minute's silence in its offices and on its transport networks on Wednesday in mourning for Monguillot.