POLICE, soldiers, dignitaries and citizens gathered hopefully in the palm-shaded central plaza of Cobija, a town in northern Bolivia, on the morning of October 1st. A large television screen mounted on a scaffold, as if to broadcast a football game, showed a session of the International Court of Justice (ICJ) in The Hague. When the court’s Somali president, Abdulqawi Ahmed Yusuf, had finished reading its judgment, the crowd dispersed dejectedly. A brass band playing Bolivia’s national anthem could not cheer them up. After five-and-a-half years of hearings and deliberation, the court ruled that Chile had no “obligation to negotiate sovereign access to the sea” for Bolivia.

This was a blow to every Bolivian, including the president, Evo Morales, who was in the courtroom as Justice Yusuf read out the humiliating judgment. Over a century ago Bolivia lost 400km (250 miles) of coastline to Chile (in the “War of the Pacific” of 1879-84). It has been trying to get it back almost ever since. Bolivia celebrates March 23rd as “the Day of the Sea”. Its constitution, adopted in 2009, calls access to the Pacific an “irrevocable” right. Cobija, a dishevelled district capital 1,000km from the ocean, is the name of a Chilean fishing village that was Bolivia’s main seaport. The judgment is “a real shame”, said Gladys Quispe, a clothes vendor in Cobija. “I was sure we were going to win.”

Chile gives Bolivia’s goods tariff-free access and lets Bolivia post its own customs officials in the ports of Arica and Antofagasta. But only territory will satisfy Bolivia. In turning to the court it did not seek to overturn the peace treaty of 1904, in which it accepted the loss of its coastline. Instead, it argued that Chile had incurred an obligation to negotiate access to the sea through a series of statements and diplomatic acts since the 1920s. By a vote of 12 to three the court said Bolivia had no case. One by one the judges knocked down Bolivia’s eight arguments. Mr Morales looked crestfallen.

The left-wing president had promised success. In August he said that Bolivia was “very close” to getting back its coastline. On the eve of the ruling he predicted “good news”. That would have lifted his low level of support. Just 29% of Bolivians would vote for him. His failure in The Hague is a blow to his plan to run for a fourth consecutive presidential term in October 2019. Although Bolivians voted in a referendum in February 2016 to deny him the right to run, the constitutional court overruled the result. His odds of winning have surely diminished. “There’s a lot of disappointment,” says José de Francesco, an entrepreneur in Cobija.

The mood in Chile is relief. Officials had feared that the court would deliver a “Solomonic ruling”, balancing the requirements of international law with sympathy for Bolivia. They were braced for a decision to require Chile to negotiate in good faith (though not to hand over coastline to Bolivia). Seeking to underline its view that the case should turn purely on the law, Chile did not even send its foreign minister, Roberto Ampuero, to The Hague. In the end, the court demanded nothing of Chile, saying merely that a settlement is a “matter of mutual interest”.

That looks as far away as ever. Bolivia has not given up. “This is not a closed subject,” said Eduardo Rodríguez Veltzé, Bolivia’s agent in The Hague, after the judgment. Chile’s president, Sebastián Piñera, is willing to talk, but if Bolivia keeps claiming Chilean territory “there is nothing to talk about,” he says. Relations may get worse. The two countries are arguing in the Dutch city in another case, over the Silala river. Chile wants the ICJ to declare the river, whose source is in the department of Potosí, 4km from Chile’s border, to be an international waterway. Bolivia insists that the water flows into Chile only because Chilean railways and miners channelled it early in the 20th century. Bolivia, which broke off diplomatic relations in 1978, is unlikely to restore them, at least while Mr Morales is president. Lawyers, not diplomats, will continue to set the tone for Bolivia’s relations with Chile.