Egypt, Ethiopia and Sudan have signed an initial agreement on how to share water from the Nile River that runs through the three countries, as Ethiopia constructs a massive new dam it hopes will help alleviate some of its electricity shortages.

Egyptian President Abdel-Fattah el-Sissi, Sudanese President Omar Bashir and Ethiopian Prime Minister Hailemariam Desalegn welcomed the agreement in speeches in Khartoum's Republican Palace on Monday. They earlier watched a short film about the Grand Renaissance Dam that highlighted how it could benefit the region.

Officials from the three countries had worked out the agreement beforehand in recent meetings in Khartoum.

Egypt previously had voiced fears that Ethiopia's $4.2 billion hydro-electric project would diminish its share of the Nile, which provides almost all of the desert nation's water needs.