At around the same time the World Health Organization was announcing on Thursday that the deadliest ever Ebola outbreak was officially over, a British laboratory in Sierra Leone was testing a swab from a woman who had died two days earlier.

The sample proved positive.

The accident of timing provided a dramatic illustration of the difficulty facing authorities in deciding when to declare an end to a major health emergency. An aid agency report seen by Reuters said the woman, Mariatu Jalloh, had potentially exposed at least 27 other people to the disease.

A British health agency, Public Health England (PHE), confirmed it had tested the sample from Jalloh at its laboratory in Makeni, in the north of the west African country.

"The sample was tested for the first time on Thursday morning - around the same time as the WHO declared the Ebola outbreak over", Tim Brooks, head of PHE's rare and imported pathogens lab, told Reuters.

"Ebola tests take approximately four hours to complete," he said. The results were communicated to Sierra Leone's health ministry "on Thursday afternoon, immediately after the initial positive Ebola test result was confirmed".

The Makeni lab, funded by the British government, is providing Ebola testing as part of ongoing surveillance for the viral disease, which has killed more than 11,300 people in the two-year epidemic in West Africa.

A spokesman for the WHO defended the decision to declare an end to the outbreak on Thursday after 42 days without any new cases in Liberia, the last country to be declared Ebola-free.

He said there was a key difference between ongoing transmission and sporadic cases.

"This really reflects what we have been saying...that there is a risk, and this outbreak is in a critical phase right now where we are moving from case management to management of risk," WHO spokesman Tarik Jasarevic told reporters in Geneva.

He added that "it is really important that people don't understand this 42-day announcement as the sign that we should all just pack up and go home. We should stay there and be ready to respond to these possible cases."

The risk of flare-ups stems from the ability of the virus to persist for months even in those who survive Ebola, including in breast milk, semen and other body fluids.

(Reporting by Kate Kelland in London and Stephanie Nebehay in Geneva, editing by Mark Trevelyan)