FRESNO, Calif. (Reuters) - California’s San Joaquin River flows out of the mountains above Yosemite, clear and bubbling until it abruptly stops just north of Fresno, its water diverted to irrigate farms.

Salmon swim along in a fish holding tank at the San Joaquin River Restoration Program's Salmon Conservation and Research Facility near Friant, California, U.S. on July 8, 2016. REUTERS/Gary Kazanjian

Environmentalists have cheered a plan to reconnect the river this fall. But it is over budget, overdue and vehemently opposed by local farmers and some Republican lawmakers. U.S. Senator Ted Cruz of Texas, a 2016 Republican presidential hopeful, once joked about eating its protected fish with crackers.

“For somebody who doesn’t really understand about the issue it seems very simple - just reconnect the river and water will flow,” said Cannon Michael, a sixth-generation farmer whose family settled in the San Joaquin Valley in the 1800s. “But the river was disconnected for a reason.”

Initially diverted to provide water for agriculture and encourage family farms, the San Joaquin River has become the latest battleground of California’s century-old water wars. Its dams, hydro-electric plants and diverted flow illustrate the benefits as well as the costs of 20th century efforts to tame the state’s natural resources.

Damming the river in 1942 was an engineering feat that made the San Joaquin a keystone of a complex water system that ultimately allowed a semi-arid state to provide water for 40 million residents and grow more fruits and vegetables than any other U.S. state, on land watered almost entirely by irrigation.

But construction of Friant Dam near Fresno also eliminated the Pacific Coast’s southernmost runs of Chinook salmon. The river is dry most years along two stretches for a total of 60 miles. It was recently named the second-most endangered U.S. river by the group American Rivers.

“Old-timers tell stories of the water being so thick with salmon that you could practically walk across it,” said Doug Obegi, an attorney with the Natural Resources Defense Council (NRDC).

In 1988, that environmental group sued the federal government, saying diverting the river broke state law protecting fish. After 18 years of court battles, environmentalists, the federal government and water users finally agreed to restore the river to again support salmon.

Since that 2006 settlement, efforts to restore the river have been slowed by engineering challenges, tense negotiations with farmers and other delays. The U.S. Bureau of Reclamation, which operates Friant Dam, is now set to release enough water to reconnect the river this fall, said program manager Alicia Forsythe.

Slideshow ( 14 images )

But improvements targeted for completion by 2013, including levees to prevent flooding and screens to keep threatened fish out of irrigation canals, have yet to start.

Environmentalists, government officials and farmers are still arguing over the path the river should take because agricultural land has encroached on its traditional route.

And farmers who rely on water diverted at Friant Dam will get less under the plan. Their allocations will drop by about 18 percent as more water is allowed to flow downstream.

Near Mendota, where levee construction is planned to begin next year, a road runs across the dry riverbed. Abandoned furniture sits in the dirt, and a target with bullet holes hangs from a tree.

Costs have ballooned, rising from an estimated $250 million to $800 million in 2006 to $1.5 billion today, said Bureau of Reclamation spokesman Shane Hunt.

The latest projected completion date is 2029.

“It’s a giant waste of time and money,” said Greg Pearl, who farms 800 acres near the river.

U.S. Rep. Devin Nunes, a Republican who represents part of the area, said the cost of restoring the river is too high, and the benefits too few. He backs a plan to build a reservoir upstream of Friant Dam so farms and communities can have access to more water from the San Joaquin, not less.

Republicans in the U.S. Congress have attached proposals to do that to numerous bills, some getting as far as the Senate before stalling there. A compromise brokered two years ago by Democratic Senator Dianne Feinstein also stalled.

Among conservationists, however, excitement about re-connecting the river is palpable.

Former NRDC scientist Monty Schmitt predicted dramatic results even from this fall’s planned releases of modest amounts of water, designed not to flood riverbanks before levees are built.

“In the span of five minutes you can go from a dry channel to a river that is 30 feet wide,” he said.

For video, click here