PARIS — A sex scandal brought an end to the campaign of a Paris mayoral candidate on Friday, an unusual episode in a country with a reputation for shrugging over extramarital affairs and the private lives of its politicians.

Benjamin Griveaux announced he was ending his campaign after the circulation of an undated video apparently depicting him masturbating — footage the politician allegedly recorded on his phone and sent to a woman who was not his wife.

His departure shakes up the Paris mayor’s race. With only a month to go before the vote, President Emmanuel Macron’s party now does not have a candidate — though Griveaux had already been trailing in the polls.

But the bigger question on people’s minds was why he bowed out and why he did it so quickly.

Griveaux, the French government’s former spokesman, cited an attack on his privacy and his family. “No one should be subjected to such violence,” he said in a recorded statement released Friday. He is married with two children.

Russian anti-state performance artist Petr Pavlensky claimed credit for releasing the video — it remained unclear how he obtained it — and said his motivation was fighting political hypocrisy.

“He’s someone who is constantly leaning on family values, who says that he wants to be the mayor of families and always cites his wife and children as an example. But in fact [Griveaux] does just the opposite,” Pavlensky told the French newspaper Libération.

Pavlensky, who claimed asylum in France after being accused of sexual assault in Russia, also said on French television that this would not be his last attempt to embarrass a French politician.

But sex is not scandalous in French politics in the way it can be in Britain and in the United States.

In Paris, there were hardly any calls for Griveaux to withdraw. In the words of one of Macron’s political advisers, quoted in the French newspaper Le Monde: “He could remain a candidate, file a complaint, and present himself as the victim of an infamous maneuver. People will say, ‘It’s disgusting.’ But it’s not necessarily as risky as changing the candidate one month out from the vote.”

A number of Griveaux’s opponents and politicians from other parties rallied to his defense.

Paris’s Socialist Mayor Anne Hidalgo, running for reelection, called for “the respect of private life and of people.” Far-left leader Jean-Luc Mélenchon — certainly no friend of Macron’s party — called the attack “odious.” Mediapart, an investigative news outlet, said it had turned Pavlensky away when he reached out to them this past week.

“These messages and videos are nothing more than a clear invasion of privacy or revenge porn,” Mediapart wrote. “In both cases, it’s a criminal offense.”

Most political journalists here approach their subjects’ private lives like the White House press corps did in the Kennedy era. Let it go, and look the other way.

Just looking at French presidents, François Mitterrand had an entire second family, Jacques Chirac had multiple mistresses, Nicolas Sarkozy met and married a supermodel, and François Hollande left his journalist companion to have an affair with a leading French actress — prompting his ex to write a tell-all book about their relationship.

And yet there has never been a French version of, say, the Monica Lewinsky scandal, not even when Mitterrand’s second family showed up at his funeral in 1996. The publication of Mitterrand’s letters to his longtime mistress, “Lettres à Anne,” was a major literary event of 2016. News outlets highlighted the emotion in the letters and the quality of the writing, never the infidelity.

French outlets generally avoided sensationalizing the Griveaux news.

But Griveaux alluded to the role of social media in his decision. “I do not want to expose my family and myself any further when nothing seems off limits anymore,” he said.

Some began to wonder if the French political ecosystem is becoming too, well, American.

Alexis Corbière, a far-left member of the French parliament, decried what he called “this Americanization of political life, where people will apologize because they have lovers, mistresses, etc.”