JERUSALEM (Reuters) - There is a foul smell coming from the biblical Kidron Valley.

It’s so bad that King David and Jesus, who are said to have walked there thousands of years ago, would today need to take a detour to reach Jerusalem.

For decades now a quarter of Jerusalem’s sewage has flowed openly in the Kidron valley, meandering down the city’s foothills and through the Judean desert to the east. At its worst, the pollution leaks into the Dead Sea.

The stream runs back and forth between land under Israeli and Palestinian administration, making a fix hard to find. But finally it seems a solution has been reached.

Authorities on both sides have agreed to drain the valley of sewage. According to the plan, a pipeline will be constructed carrying the wastewater directly to new treatment facilities. Each side will fund and build the section that runs through its territory.

Until that happens, however, about 12 million cubic meters of sewage continue to flow through the valley each year.

“Of course it’s damaging the environment and the ecological system,” said Shony Goldberger, director of the Jerusalem district in Israel’s Environmental Protection Ministry.

Slideshow ( 11 images )

“It’s dangerous and hazardous to the health of the people in many ways.”

Added to Jerusalem’s sewage along the stream’s 30 km (19 mile) descent through the occupied West Bank is effluent from Bethlehem and nearby Arab villages.

Plants grow anomalously in what should be a dry wadi, animals come to drink, and mounds of baby wipes flushed down thousands of toilets sporadically coagulate along the banks. Sewage seeps into the earth, risking contamination of ground water.

Toward the end of the journey it gathers in a makeshift collection pool and much is used to irrigate date trees, which have a high tolerance for pollutants. But every so often gravity pulls the refuse toward the lowest spot on earth, the Dead Sea.

“It’s like a brown stain,” Goldberger said. “It stays disconnected from most of the salty water of the Dead Sea.”

With Israeli-Palestinian peace talks at an impasse, projects that require even minor cross-border coordination seldom get done. Israel captured the West Bank in a 1967 war, but under interim peace deals the Palestinians exercise limited self-rule in part of the territory.

Slideshow ( 11 images )

“After decades of not being able to solve the problem, for a thousand and one reasons, professional and political, we reached an agreement for building a pipeline in the valley,” Major General Yoav Mordechai, the coordinator of the Israeli government’s activities in the West Bank, told Reuters.

The Palestinian Water Authority said the agreement was reached out of an “interest to clean the area,” but emphasized the two sides were working separately.

While they are both are optimistic, some scepticism remains, since similar plans in past never gained traction.

“We were talking about it, planning it, every time it took two, three, four years. You think you have it, and then the light at the end of the tunnel turns out to be a truck coming at you,” said Goldberger.

“I hope this solution will reach the stage where it is built.”