BEIRUT (Reuters) - Syrian government forces have recaptured all towns and villages in the Wadi Barada valley near Damascus, the Syrian military said on Sunday, in another blow to rebels who have fought for years to unseat President Bashar al-Assad.

"Units of our armed forces, together with ... allied forces have achieved their mission in returning security and stability" to the area, the military said in a statement read out by a spokesman on Syrian state television.

The military's offensive, launched last month, aimed partly to seize control of a major spring and water pumping station which supplies most of the capital's water. Fighting and damage to the site caused acute water shortages in Damascus this month.

State TV broadcast footage of Syrian soldiers standing in the water pumping station in the village of Ain al-Fija.

The recapture of Wadi Barada signals the fall of another rebel-held area in western Syria, and comes weeks after insurgents were driven from areas they controlled in Aleppo, their last major urban stronghold.

Military support from President Bashar al-Assad's foreign allies, including Russia, Iran and Lebanese group Hezbollah, have been instrumental in helping turn the nearly six-year civil war in his favour.

On Saturday the army took over the spring in Ain al-Fija as part of an agreement reached with rebels, who had held the area since 2012, pro-Damascus media outlets and the Syrian Observatory for Human Rights monitoring group said.

Under the agreement, dozens of rebel fighters were expected to be bussed out of the area on Sunday with their families and head for Idlib province, an insurgent stronghold.

Similar previous deals in western Syria have seen rebels evacuate areas they had held for years and depart with their families for Idlib. The opposition says this amounts to forced population transfers.

The deals have usually been struck in places where government forces and their allies have either besieged rebel-held areas or have gained the upper hand militarily.

(Reporting by John Davison and Kinda Makieh in Damascus; Editing by Susan Fenton)