Fifteen dams have been built on the Douro to regulate the water flow, generate hydroelectric power, and allow navigation through locks. Beginning at the headwaters, the first five dams are in Spain: Cuerda del Pozo, Los Rábanos, San José, Villalcampo and Castro Dams. The next five downstream are along the Portuguese-Spanish border; the first three are owned and operated by Portugal: (Miranda, Picote and Bemposta Dams), while the next two belong to Spain: (Aldeadávila and Saucelle Dams).