(Adds comment from Ecuador)
LIMA, July 10 (Reuters) - Peru has recalled its ambassador to Ecuador after Quito refused to stop building a wall along a canal separating the two, Peru's Foreign Affairs Ministry said on Monday as both countries expressed concern over flood risks.
Peru said construction of the concrete wall, part of an urban revival project, violates a peace treaty signed by both countries because it comes too close to a canal in populated areas along the Zarumilla River, which forms part of the border for the two countries.
Ecuador said it lamented Peru's decision to recall its ambassador and said Peru had not responded to its request last week to discuss the dispute in a high-level meeting.
"Ecuador believes that dialogue is the valid mechanism to overcome any divergence between sister countries, and therefore reiterates its willingness and openness to address these issues immediately," the country's Foreign Affairs Ministry said in a statement.
The dispute marks a rough start to bilateral relations between Ecuador and Peru under centrist Peruvian President Pedro Pablo Kuczynski and Ecuador's socialist President Lenin Moreno, both of whom took office in the past year.
The dispute underscores both countries' sensitivity to the kind of heavy flooding in the border region that could become more extreme with climate change.
Ecuador has said the wall would help control flooding that affects border towns every year but Peru said it could disrupt the flow of water in the canal and raise flood risks for Peruvians.
Peru had extreme flooding earlier this year after a sudden warming of Pacific waters off its coast triggered some of the nation's heaviest rains in decades. More than 150 people died and reconstruction efforts could cost up to $9 billion, according to the government.
Peru also has said the wall would hurt efforts to remove bureaucratic barriers at the border.
In the 1990s, territorial disputes led to a three-year war between the two countries, which share a 1,529 kilometer-long (950 miles) border. Cross-border trade remains fluid, but passage of contraband is common. (Reporting by Mitra Taj in Lima and Alexandra Valencia in Quito; Editing by Lisa Von Ahn and Bill Trott)