The Chagres River is a river in central Panama. The central part of the river is dammed by the Gatun Dam and forms Gatun Lake, an artificial lake that constitutes part of the Panama Canal. Upstream lies the Madden Dam, which created Lake Alajuela (Lago Alajuela), a reservoir that is also part of the Canal Zone water system. The river drains northwest via the canal into the Caribbean Sea.The Madden Dam was built to prevent the occasionally torrential flow of the once wild Chagres River, which flows into the navigational route of Gatun Lake. The river's unruly flow posed a major challenge to the construction of the Panama Canal. Water from the dam's reservoir is also used to generate hydroelectric power and to supply Panama City's fresh water.