With quick and coordinated action by some of its top doctors, Nigeria, Africa’s most populous country, appears to have contained its first Ebola outbreak, the United States Centers for Disease Control and Prevention said Tuesday.

As the epidemic rages out of control in three nations only a few hundred miles away, Nigeria is the only country to have beaten back an outbreak with the potential to harm many victims in a city with vast, teeming slums.

“For those who say it’s hopeless, this is an antidote — you can control Ebola,” said Dr. Thomas R. Frieden, director of the C.D.C.

Although officials are pleased that success was achieved in a country of 177 million that is a major transport and business hub — and whose largest city, Lagos, has 21 million people — the lessons here are not easily applicable to the countries at the epicenter: Guinea, Liberia and Sierra Leone. Public health officials in those countries remain overwhelmed by the scale of the outbreak and are desperate for additional international assistance.