The French president, Emmanuel Macron, was struggling to contain a fresh crisis after the resignation of one of his earliest and closest backers, the interior minister, Gérard Collomb.

Collomb’s departure, which leaves the French government in a state of flux, follows the resignation of the popular environment minister Nicolas Hulot and just as Macron is facing falling approval ratings and a continuing controversy over an Élysée security official who was filmed assaulting people on the edge of a demonstration.

Collomb, 71, a former mayor of Lyon who had been one of Macron’s most loyal allies, left the government after an extraordinary stand-off with the 40-year-old president, who at first refused to let him go but then announced his departure in the early hours of the morning.

Macron’s prime minister, Edouard Philippe, was hastily forced to take on the interior minister’s national security duties on Wednesday in addition to his prime ministerial role.

Officially, Collomb’s reason for leaving was that he wants to run again for his old job as mayor of Lyon in the next local elections. But Collomb – who once said he and Macron were like father and son – had also made public warnings about the danger of Macron becoming cut-off from citizens.

He was reportedly angry at the damaging scandal surrounding Alexandre Benalla, a Macron security official who was filmed beating two people on the edge of a protest in May.

Collomb’s dramatic departure comes at a difficult moment for Macron. The young centrist who has vowed to “repair” a divided France by liberalising the economy, overhauling welfare and labour laws and reinventing the political class has in recent months seen his popularity rating drop to about 34%.

The pro-business president has struggled to rid himself of the label “president of the rich”, seen as acting more in the interest of high-earners than poor families. He has also been accused of being arrogant and aloof, particularly in his dealings with the public. In one recent incident, Macron told an unemployed gardener he could find him a job “by crossing the road”. The comment was seen to imply that, in a country of mass unemployment, those without a job just weren’t trying hard enough.

Collomb pointedly and publicly warned Macron about this via the media this month. Asked on TV why the president’s approval ratings had fallen, he said it was perhaps due to a “lack of humility” in the administration, warned against “hubris” and said Macron’s repeated use of expressions such as the English-language “start-up nation” were creating a gulf with ordinary citizens.

Collomb later implied to a group of journalists at a lunch that Macron was isolated and did not take ” advice. He said: “Very few of us can still talk to [Macron].”

He added: “Soon he won’t put up with me any more. But if we all bow down before him he’ll end up isolated.”

Collomb’s resignation so soon after Hulot stormed out saying Macron was not doing enough to fight climate change, is also a personal blow to the president.

Collomb, who was mayor of Lyon for 16 years and a stalwart of local politics, was one of the first political heavyweights to rally behind Macron’s outsider bid for president in 2017, bringing an important regional support base. During the presidential campaign, Collomb often travelled around tiny halls in working-class neighbourhoods talking about his life as the son of a factory worker and cleaning lady, saying Macron, a former banker, would transform the country.

He wept with apparent emotion at Macron’s presidential inaugurationin 2017. But their relationship reportedly soured this summer over the scandal surrounding Benalla.

Benalla, who worked for Macron at the Élysée, was filmed illegally dressed as a police officer, assaulting two people on the edge of a Paris protest in May and is under police investigation. A vast political scandal blew up when it emerged that senior officials knew about Benalla’s actions.

Appearing at a parliamentary inquiry, Collomb had pointed blame at Macron’s office, saying it was their responsibility to report the incident to prosecutors.

The job of interior minister — responsible for policing and immigration — is a crucial senior position in government.

Collomb, who had pushed through a controversial hardline immigration policy and had been criticised for not going far enough in reforming local policing, warned as he left that the government must do more to solve the problem of insecurity in poorer neighbourhoods that he said were becoming dominated by drug-dealers and extremists.

Independent of his dropping approval ratings, Macron maintains a strong parliament majority that allows him to push through his policy changes unhindered by the political opposition, which remains fragmented. But his public image and support are important if he is to succeed in the “transformation” he is promising for France.

Collomb is the third minister to step down in two months. Hulot, the high-profile environment minister and former TV presenter, left without warning, saying he was exasperated with the lack of commitment to environmental issues. The popular sports minster, Laura Flessel, left shortly after, saying it was for “personal reasons”.