Max Mosley, the son of England’s two most notorious fascist leaders who forged his own legacy leading the international governing body of motorsports and successfully battled a British tabloid after he was secretly filmed at a sex party involving Nazi-style costumes, died May 23 at 81.

His friend Bernie Ecclestone, who for many years ran Formula One racing within the International Automobile Federation, known by its French initials FIA, announced the death on Twitter. A family statement said the cause was cancer. No further information was available.

Mr. Mosley rose to become the FIA’s president from 1993 to 2009 despite a surname that made many Britons shiver. His parents, Oswald Mosley and the former Diana Mitford, were the leading pro-Hitler British fascists before, during and even after World War II — and spent most of the conflict, and their son’s infancy, in prison and then house arrest as threats to the nation.

After training for a legal career, Mr. Mosley served his father’s extreme right-wing political party, the Union Movement, before being drawn into the thrill-seeking of motor sport, first as a racer and then on the business side.

Mr. Mosley’s tenure as a Formula One racing executive was marked by upheaval, even crisis, with individual team bosses, most notably at Ferrari, McLaren and Williams, often in conflict with the FIA over commercial rights, technical regulations, safety measures and other issues.

A low point came in 1994 when two F1 drivers, the Brazilian three-time world champion Ayrton Senna and Austrian rookie Roland Ratzenberger, were killed in separate crashes during the San Marino Grand Prix weekend in Imola, Italy. Senna was one of the best-loved racers in the world and almost a deity to Brazilians.

Mr. Mosley was widely lauded for how he moved F1 forward from that black weekend, improving driver and spectator safety at racetracks. He also worked closely with the European Union on general road safety, introducing a program of mandatory crash tests by auto manufacturers, a move that considerably reduced driving deaths.

Those who dealt with Mr. Mosley often echoed the same descriptions: charming and intimidating; urbane and volatile; above all ruthless. The BBC’s chief F1 correspondent, Andrew Benson, wrote after Mr. Mosley’s death: “With a brilliant intellect and a devious, sometimes malicious mind, he was arguably better suited to a career in politics.”

He had, in the early 1980s, sought to become a Conservative Party candidate but found that his surname was still being held against him within the party. In the 1990s, he turned his support, including financial, to the Labour Party of Tony Blair but withdrew as a party donor after Britain joined the U.S.-led coalition that invaded Iraq in 2003.

The Mosley family legacy continued to reverberate into the 21st century. In 2008, Britain’s hugely popular tabloid newspaper the News of the World, owned by publisher Rupert Murdoch, carried a front-page story headlined: “F1 Boss Has Sick Nazi Orgy With Five Hookers.”

A woman had secretly filmed a private party in London attended by Mr. Mosley in which Nazi uniforms were worn, leather whips were used and some women were dressed in striped pajamas that resembled the clothing of concentration camp inmates.

A barrister, or trial lawyer, by profession, Mr. Mosley sued the paper, winning 60,000 pounds in damages plus 450,000 pounds in legal costs. The judge accepted his argument that his privacy had been invaded and that the party, although sadomasochistic, had involved consenting adults, was not “an enactment of Nazi behavior” and was “a perfectly harmless activity.” The judge added, however, that Mr. Mosley had shown “reckless and almost self-destructive” behavior at the party.

Although his reputation was badly tarnished, not least among Jewish groups, the News of the World’s methods also came under attack. Hit by a loss of advertising and numerous allegations of phone-hacking, the paper was forced to shut down in 2011.

For beating the tabloids, Mr. Mosley became a hero to many celebrities who felt their privacy had been breached by the grubby side of the media. The Mosley case led to much tighter privacy laws in Britain. Media lawyer Mark Stephens told the BBC that Mr. Mosley was “effectively the author of modern privacy law.”

Max Rufus Mosley was born in London on April 13, 1940. His father was leader of the British Union of Fascists, and his mother one of the six famous Mitford sisters, aristocratic socialites on the London scene. The couple had long been open about their pro-Nazi sympathies and were married in 1934 at the home of Hitler’s propaganda minister, Joseph Goebbels, with Hitler himself as guest of honor.

Within weeks of Max Mosley’s birth, when Hitler’s troops had started invading France and were menacing the United Kingdom, both of his parents were imprisoned in London as national security threats. After a period of house arrest, they were released after the war. They moved to France but sent Max to school in Germany’s Bavaria region.

A school official got a shock when he asked Max about his father’s profession. “Faschistenführer” (fascist leader), the boy replied.

When the family returned to England in the 1950s, Max Mosley attended a boarding school before going to the University of Oxford, where he became secretary of the Oxford Union debating society and got a degree in physics in 1961.

In 1960, he married Joan Taylor, a policeman’s daughter. After further studies in law, he qualified as a barrister in 1964 and immediately became involved in his father’s new party, the Union Movement, which continued the family’s racist ideology.

Mr. Mosley was once arrested for punching an anti-fascist demonstrator who had knocked his father to the ground during a right-wing event. He was acquitted after insisting that it was every son’s duty to defend his father. Even in later life, he never condemned his father, who died in 1980.

“He really minded about social injustice, things like children with no shoes and extreme poverty,” Mr. Mosley said in an interview, cited by the Times of London, when his autobiography “Formula One and Beyond” was published in 2015. “He was, I think, very courageous.”

In the mid-1960s, Mr. Mosley tried his hand at auto racing, reaching Formula Two, the level beneath Formula One. He took part in the tragic 1968 Formula Two race at Hockenheim, West Germany, in which Scottish F1 champion Jim Clark was killed.

Realizing his own limitations as a racer, Mr. Mosley co-founded an engineering group that built the chassis for the Tyrrell team, with reigning world champion Jackie Stewart at the wheel.

After the team ran into financial difficulties in the early 1970s, Mr. Mosley entered the executive side of racing. He became known for his steely determination, winning numerous power struggles, often with Ecclestone on his side, over TV deals and the financial spoils of advertising. He cracked down on racial abuse directed at F1’s only Black driver, Lewis Hamilton, a seven-time world champion.

As FIA president, Mr. Mosley oversaw not just motorsports but driving in general, including road safety and protecting the environment. He introduced measures to cut emissions in racing and pushed for technology that would also be beneficial to cars driven by the public.

France made Mr. Mosley a Chevalier (knight) de la Légion d’Honneur in 2006 for his work in motorsports and driving safety.

Survivors include his wife and a son, Patrick Mosley. Another son, Alexander, died in 2009. His mother, Diana, died in 2003.

Although the media were often among his foes, Mr. Mosley burst into hearty laughter at an event in 2009 when British journalists gave him a gift to mark his resignation from the FIA: a brown leather whip made by Swaine Adeney Brigg, bespoke luxury goods provider to the Queen.