For three days last week, counterterrorism officials and experts from dozens of countries gathered in Brussels for a conference on a threat quietly gathering in the city around them.
They passed through an airport whose vulnerabilities had been assessed by Islamist militants. Some even stepped off a subway system already marked as a soft target. They heard a top Belgian official warn that the recent arrest of a suspect in November's Paris attacks had exposed only the edge of a larger network.
The suspect, Salah Abdeslam, "was ready to restart something from Brussels" four months after he went underground, said Didier Reynders, the Belgian Foreign Minister. At the conclusion of the massive manhunt, authorities had "found a lot of weapons, heavy weapons ... and we are seeing a new network of people around him in Brussels."
The arrest of Abdeslam appears to have set off a race between security officials in Belgium and a terrorist cell that must have known that it had limited time to act. On Tuesday, the authorities lost.
The attacks were promptly claimed by Isis (Islamic State), the terrorist group that has unleashed a series of external plots as its territory in Syria and Iraq has begun to shrink. Belgian officials described the devastation as a "black day", darker than any the country had seen since World War II.
The carnage also exposed the extent to which Belgium has become the Western hub of a terrorist threat that has spread from Isis' strongholds in Syria across the Middle East and deep into Europe.
Belgium has seen a larger share of its Muslim population leave to fight in Syria than has any other Western country. The Molenbeek district of Brussels, the capital, is a particularly fertile breeding ground for militants, including several involved in the Paris attacks that killed 130 people last year.
Belgium was the first country in Europe to face an attack on its soil tied to Isis: a shooting at a Jewish museum in Brussels that killed four people nearly two years ago. But despite that early wake-up call, the carnage Tuesday showed how woefully vulnerable Belgium remains.
"It's kind of astonishing how hard it is for bureaucracies to be galvanised without direct experience of a major terror attack," said Daniel Benjamin, a former counterterrorism official at the United States State Department. "The tragedy is that country after country has had to learn this the hard way."
A nation of 11.2 million, Belgium has had at least 470 of its citizens enter Syria to join the fighting since the civil war began there four years ago. That is triple the number of suspected fighters who have attempted to get to Syria from the US. And the ratio of Belgian fighters - about 45 for every 1 million citizens - is more than twice that of its neighbour France.
Even before Tuesday's attacks, those statistics made counterterrorism officials concerned that Belgium would face a dangerous "boomerang effect". "When you have these large numbers of foreign fighters, Isis can cherry-pick the best ones to give them training and dispatch them to their home country to carry out attacks," said Bruce Hoffman, a terrorism expert and director of Georgetown University's Centre for Security Studies. "Even if Isis dispatches only 10 per cent of these fighters, you've got the foundation of a potentially highly effective terrorist cell and support network."
Initially, exporting violence did not appear to be one of Isis' priorities. For months after its declaration in 2014 of a restored caliphate, the organisation's energies seemed focused on expanding and controlling its territory in Syria and Iraq.
But US officials and experts believe that Isis has shifted its strategy over the past year as it has lost territory and momentum under a barrage of US-led airstrikes and ground operations by Western-backed militias.
In its statement claiming responsibility for Tuesday's attacks, the group suggested that the subway and airport bombings were a response to "aggression against the Islamic State". Video messages posted by Belgian Isis veterans in recent weeks have warned of new attacks against Europe.
About 118 of Belgium's departed fighters are believed to be back in Europe - part of a much broader stream of militants returning from Syria that has unnerved European security services.
Belgium's relatively small security force is widely regarded as among the least effective in Europe, and it has struggled to penetrate the country's homegrown Islamist network or track the movements of Isis veterans.
It took Belgian officials four months to locate Abdeslam, the Brussels native and alleged lone survivor of the cell that carried out the Paris attacks on November 13. Europe's most-wanted fugitive was finally captured on Saturday, even though he had been hiding out in the Belgian capital, not far from his childhood home.
In the past two years, at least seven other Islamist terrorist attacks or foiled plots have taken place on Belgian soil or have been linked to Belgian nationals. Several of the alleged culprits previously fought for Isis or other jihadist groups in Syria or Iraq.
Because of Europe's open borders, Belgium's terrorism problem now threatens all its neighbours, Hoffman said. "In Europe, individual countries are only as strong as their most vulnerable neighbour," he said.
In his remarks at the Brussels security conference, Reynders said Abdeslam had told investigators he was supposed to take part in the suicide bombing of a football game at the Stade de France but didn't follow through.
"We don't know why," Reynders said at the conference.
Reynders' comments came during a panel on Monday at a hotel just blocks from the Maelbeek metro station, scene of one of Tuesday's attacks. "We need to dismantle a lot of cells, a lot of groups of terrorists, a lot of networks," Reynders said.