The World Health Organization declared Nigeria Ebola free on Monday after a 42 day period with no new cases, in a success story with lessons for countries still struggling to contain the deadly virus.

"Nigeria is now free of Ebola," WHO representative Rui Gama Vaz told a news conference in the capital Abuja, prompting a round of applause from other officials.

"This is a spectacular success story ... It shows that Ebola can be contained but we must be clear that we have only won a battle, the war will only end when West Africa is also declared free of Ebola."

The first case in Nigeria, Africa's most populous nation, was imported from Liberia, when a Liberian-American diplomat called Patrick Sawyer collapsed at the main international airport in Lagos on July 20.

Because the country was ill prepared and had no screening procedures in place, Sawyer was able to infect several people, including several health workers in the hospital where he was taken, which did not have proper protection equipment.

Ebola has killed 4,546 people across Liberia, Guinea and Sierra Leone, the three worst-affected countries.

Nigeria had 20 cases in total, of which eight died.

The announcement that Africa's biggest economy has, for now at least, stamped out the deadly hemorrhagic fever, follows a similar declaration in much smaller Senegal, where one case was imported from Guinea.