BERLIN (Reuters) - Chilean President Sebastian Pinera on Wednesday said he was prepared to consider an appeal by his Bolivian counterpart for fresh dialogue over a long-running border dispute but added Bolivia must first drop its demand for access to the sea through Chilean territory.

Chilean President Sebastian Pinera talks during a news conference with German Chancellor Angela Merkel in Berlin, Germany, October 10, 2018. REUTERS/Fabrizio Bensch

“Chile has a readiness to dialogue with all countries, especially with neighboring countries,” he told reporters during a visit to Berlin.

Pinera added, however, “It must be quite clear that the 1904 border agreement between Chile and Bolivia is recognized ... Bolivia must give up its absurd demand for access to the sea and to Chilean territory.”

Bolivia surrendered its 250 miles (400 km) of coastline to Chile in a 1904 treaty following the War of the Pacific, leaving it landlocked.

Since then, the two neighbors have held occasional talks about a possible corridor to the sea for Bolivia. Chile currently allows Bolivia duty-free access to the port of Arica.

However, Bolivia aspires to have a train line and port under its own control, and Morales in 2012 halted cross-border discussions he saw as fruitless in favor of seeking a legal ruling to bolster his case.

On Oct. 1 the International Court of Justice ruled that earlier discussions about a sea corridor did not create any obligation for Chile to grant “sovereign access” to the Pacific Ocean.

Pinera was responding to an open letter by Bolivian President Evo Morales released on Tuesday night in which the latter highlighted the court’s comment that there was nothing to stop the two nations from talking further “in the spirit of good neighborliness.”

Morales said resolving the impasse between Chile and Bolivia, which severed diplomatic relations in 1978, was of “mutual interest” and invited his Chilean counterpart to “reopen dialogue.”

He vowed in comments in The Hague after the court ruling, however, that Bolivia would never give up its demands for sea access that was taken from it in an “invasion.”