SAN JOSE — After years of debate, San Jose is finally getting fluoride in its drinking water.

A unanimous vote Tuesday by the Santa Clara Valley Water District endorsed a funding plan for the long-anticipated project for the largest city in the country without fluoridated drinking water. But it will take about two more years to finalize the details and retrofit local water plants to bring the additive aimed at saving children’s teeth from decay to the city’s taps.

“It’s a big deal,” said Dr. Marty Fenstersheib, Santa Clara County’s health officer. “I used to ask people, ‘What do you think of the fact we don’t have fluoride in our water in San Jose?’ A lot of people will tell you ‘I didn’t know we didn’t have it.”’

Even with this project, though, San Jose residents won’t be getting the optimal amount of fluoride in their drinking water.

While the water district came up with a public-private partnership to fund the $6.6 million to retrofit its three main plants for fluoride over the next two years, its largest customer — San Jose Water Co. — still needs to come up with another $18 million to retrofit dozens of its wells. Until then, San Jose Water customers will only get a diluted amount of fluoride.

Still, health advocates are thrilled that at least some fluoride will start flowing through household taps.

“This is a great day for the children of Santa Clara County,” said Frederick J. Ferrer, CEO of The Health Trust, he county’s largest provider of children’s dental services, which is contributing $1 million to the fluoridation project.

Fluoridating water has been shown to decrease cavities in children as much as 40 percent, according to The Health Trust, and in most cities, every $1 invested in water fluoridation saves $38 in dental treatment costs.

Poor dental health among children in the county “is probably the number one health problem,” Fenstersheib said. One in three children have at least one cavity by the time they start school, he said, with some needing root canals on baby teeth. Parents still need to avoid giving their children sugary drinks or putting them in bed with bottles of juice, he said. But even so, fluoride in drinking water will help families who can’t afford dental care.

“When we talk to school nurses, they say kids come to school all the time with terrible dental issues and aren’t ready to learn,” Fenstersheib said. “They can’t concentrate.”

Critics who have packed public meetings on the issue over the past several years have long argued that fluoride in water isn’t safe, saying too much of the chemical can pit the teeth, aggravate thyroid problems and causes other ailments. Health officials cite studies that have long disputed those concerns.

Although Tuesday’s vote established a framework for paying for the project, the district still will have to negotiate details with the three nonprofits and will have to approve its own share as part of its 2014 budget.

Some $2.4 million of the $6.6 million Water District retrofit project will be paid for from donations from three nonprofits, including The Health Trust, First 5 Santa Clara County and the California Dental Association Foundation. Once the project is running, average households of five can expect their monthly water bill to increase about 50 cents a month.

It’s been a long time coming. San Francisco began fluoridating water in the 1950s.

“We’re the last large metropolitan district to do it,” said Tony Estremera, a water district board member who voted in favor of the project Tuesday. “Probably the biggest reason is because our system is so complex. We have this diversity of sources and a complex system. How you integrate it all together has always been a big problem.”

Palo Alto, for instance, gets its water from Hetch Hetchy, which is already fluoridated. Mountain View and Milpitas also have fluoridated water from other sources, as does the Evergreen neighborhood of east San Jose served by its own small water company. Cupertino, Saratoga and Campbell and some areas near the corridors of highways 85 and 87 have small amounts of fluoride that are mixed with their water. But most of San Jose, including downtown, and parts of the city of Santa Clara are still waiting.