PARIS — An electric delivery boat pushed up the Seine, past the former palaces and elegant museums and under the low-slung stone and metal bridges before turning at the Eiffel Tower and gliding to the riverbank.

The captain, Arnaud Montand, was tracing the planned path for the opening ceremony of next summer’s Olympic Games and, over the last segment of its route, the course for Olympic swimmers.

A key part of Paris’s winning bid was not to host events just on the river but, remarkably, in it.

“What a beautiful window onto Paris,” Montand said from behind the wheel inside his cozy glass cabin, where he was protected from the pelting rain. “But if there is a storm, all of it will be off.”

For years, workers across greater Paris have been implementing what is known as the Swimming Plan — an engineer’s dream, involving thousands of new underground pipes, tanks and pumps designed to prevent damaging bacteria from flowing into the Seine, particularly during storms. If successful, the plan will yield a river clean enough for Olympians and, later, citizens, to swim in.

“Do we have a 100 percent guarantee? The answer is no,” said Pierre Rabadan, the deputy mayor heading up the city’s Olympic plans, including the cleanup of the Seine in time for it to host two long-distance races and the swimming legs of the triathlon. “If it rains for a week continually before the races, we know the quality of water — even with all the work that has been done — probably won’t be excellent.”

But Rabadan also said there was no alternate plan: If the races must be postponed, organizers will simply wait a few days, test the water quality and try again.

Considered by many the most romantic river in the world, the Seine is also smelly, murky and — after big Saturday nights — fringed with the filthy residue of partygoers. During huge rainstorms, 40 portholes dotting the river’s paved banks gush with sewage.

That’s why many Parisians — even some working on the official Swimming Plan — look aghast at the idea of diving into the river.

“Have you seen the Seine?” Michael Rodrigues said from deep in a hole in a sidewalk, where he was connecting a new pipe to a house so it no longer oozed sewage into the river. “I’m not interested.”

That was not always the case. During the first Olympic Games hosted by Paris, in 1900, seven swimming events were held in the river. Even after swimming in it was banned in 1923, a year before the Games returned to the city, locals continued to dive off the Pont d’Iéna on hot summer days, the Eiffel Tower rising behind them as they cooled off in the water.

But the river became more and more polluted with sewage and industrial waste. A study in the 1990s classified the stretch running through Paris as having one of the highest heavy metal levels in the world, according to a history of the river.

Promises to return to those swimming days were made by Jacques Chirac, a former Paris mayor and later France’s president, who vowed in 1990 that in three years, “I will swim in the Seine in front of witnesses to prove that the Seine is a clean river.”

That never happened.

“It was just nice words,” said Jean-Marie Mouchel, a hydrologist and professor at Sorbonne University who has studied the Seine for three decades. Although many improvements to the river’s water quality have been made, particularly through the modernization of sewage treatment plants, “there was no plan for swimming in the Seine before 2020,” he said.

The Olympics have changed that — not just by prompting the plan, but by inspiring a budget of 1.4 billion euros (more than $1.53 billion) to implement it.

One legacy of the Games, the city’s mayor, Anne Hidalgo, has promised, will be giving locals access to some 20 swimming areas along the Seine and its upstream tributary, the Marne, by the summer of 2025.

“The Games were just an accelerator for the transformation and improvement of the water quality,” said Rabadan, adding that the plan had brought together more than two dozen government bodies, water and sanitation agencies, as well as river and port authorities, which otherwise “likely wouldn’t have committed.”

The aim of every agency involved is to make the water clean enough that levels of two indicator bacteria — E. coli and intestinal enterococci — are below the standards set by the European bathing directive. Olympic standards allow for slightly higher levels, given approval of a committee.

Teams in France have been testing the Seine’s water regularly since 2020. Last summer, about half of their samples met the target. But those were taken over a long stretch of the river and its tributary over three summer months.

When workers tested the course of the planned Olympic events — the swimming part of the triathlon and two 10-kilometer events for men and women — over two weeks in late summer, when the Olympics will take place, the results were 90 percent “fair,” meaning an Olympic committee would have to decide whether to proceed.

Rabadan and other city staff members considered that promising, given that the bulk of the Swimming Plan has yet to be implemented.

“We are not purifying the Seine,” said Samuel Colin-Canivez, the city’s lead engineer in charge of sewage projects, as he led a tour down a freshly built tunnel that stretches under the river. “Our approach is to keep untreated water from being dumped into the Seine.”

The 700-meter tunnel connects to a huge underground storage tank under construction between the Austerlitz train station and a 350-year-old hospital. Between them, they will have space to hold 13.2 million gallons — enough water to fill 20 Olympic pools.

The tunnel and the tank are among five big engineering projects being built to deal with storms, which now overwhelm Paris’s antique sewer system, and more important, to funnel both sewage and rainwater. When those tunnels are overwhelmed by rainwater, they release everything — rain, sink and toilet water — into the Seine.

“Right now, that happens 12 times a year when it rains hard in the east part of the city,” Colin-Canivez said while walking around the partially constructed tank. Once completed, the giant reservoir will hold that water during storms and then slowly reintroduce it back into the sewer system after the rain stops. “Our objective with this is to get that down to two times.”

That is the rainy weather strategy to keep sewage out of the Seine. The dry weather strategy involves another set of projects. Some are straightforward, like adding special treatments to two upstream sewage plants. The bigger plant, Seine-Valenton, absorbs the wastewater of 2.5 million people, six miles southwest of Paris. Once small amounts of performic acid are introduced to its discharge in June, the levels of harmful fecal bacteria will be cut by one hundred times, said Vincent Rocher, director of innovation at the Greater Paris Sanitation Authority.

Others are smaller and more personal, like the teams going door to door in six suburban areas of Paris, trying to persuade more than 20,000 homeowners to allow workers to dig up their pipes and reconnect them properly to the sewer system. That’s how many homes are believed to send their wastewater into the Seine or the Marne.

“House by house,” said Claire Costel, who leads the project in the region just southeast of Paris. “There is no other way to do it.”

Here, there are two separate underground systems of tunnels: one just for sewage and another reserved for rainwater. In many cases, though, builders connected sewage pipes to the rainwater system. In others, like on the small island of Fanac, houses were built to dump their sewage directly into the Marne.

The only way to figure out which houses have bad connections, Costel said, is to check their pipes. Then, her team tries to persuade the homeowners to allow them to fix the error.

Even though the teams are able to offer grants of 6,000 euros that often cover the renovation costs, many homeowners refuse. By last March, only about 5,000 had accepted, according to a city report.

“It’s delicate,” Costel explained. “We can’t force them to open their doors.”

Her team has been the most successful: It has built a new sewer line and pumping system for the 40 houses on Fanac.

The selling point for many residents, on Fanac and in nearby towns, was the Olympic legacy.

“I learned to swim as a child in the Marne,” said Jean-Louis Bourgeois, 70, standing outside his brick house in Le Perreux-sur-Marne one morning after workers labored to complete his sewer system. “I would be very happy to swim again there.”

Inside the Paris city limits, it’s not houses workers are targeting, but boats. Some 170 are moored along the banks of the Seine upstream of the Olympic sites. Until recently, almost all dumped their sewage directly into the river.

In 2018, the city declared that all boats needed to be connected to the city’s sewage system, and the port authority began the expensive process of installing sewage connections and pumps in the ports that didn’t have them. Water dwellers were given two years to put in coupling wastewater collection systems in their boats.

To date, only around half have done the work, according to city employees.

Many boat owners have complained that they are being unfairly targeted. Unlike their terrestrial neighbors, they were not offered a choice, and retrofitting old boats can cost as much as 25,000 euros — five times what the government offers in grants.

“Do you think the boat park 30 kilometers from Paris will be connecting to a wastewater system?” said Hervé Lavollée, who lives on a retrofitted 1937 barge moored near a pedestrian bridge in the heart of Paris. “They make noise on all this for the 8 p.m. news so they look like they are doing a lot, but it’s ridiculous.”

Nicolas Londinsky, the director of water and sewage systems in Paris, acknowledges that the boats’ pollution is comparatively small, but says it could make the difference between a passing water-quality test at a nearby swim area and a failing one. “If we really want to improve the water quality, we have to do everything,” he said.

And despite his criticisms, Lavollée said he liked the idea of swimming in the Seine. Each night, as he brushes his teeth in his boat’s bathroom, he looks out at the river, sparkling beneath the city’s lights.

He is continually astonished by its beauty.

“If we have the chance to show the world what is the Seine, and offer this view of Paris,” he said, “it’s a great idea.”