The writer is president of Liberia.

As the Ebola nightmare continues in Liberia and as we battle to contain the epidemic, it is important to look beyond the immediate crisis. Many more lives will be lost before this dreadful outbreak is beaten, but to properly honor the memory of the victims we need to ask how it happened in the first place and, more pressingly, how we can prevent it from happening again.

After 30 years of brutal civil and political unrest, Liberia was a nation reborn. We transformed our country from a failed state into a stable democracy, rebuilding its infrastructure and its education and health systems, and enjoying one of the most promising growth records in Africa. Then Ebola swept in, threatening to tear apart that progress. It is a terrifying reminder of the destructive power of infectious disease, one all the more devastating given how far Liberia has come.

Without a doubt, part of the reason for this situation is that, with the exception of Doctors Without Borders, the initial international response to this emergency was markedly slow. This gave Ebola the time it needed to overwhelm our already-fragile health infrastructure.

President Obama has since committed to sending up to 4,000 military personnel to West Africa to set up much-needed health-care facilities and to train health-care workers, and last week he authorized the use of additional reserves, if needed. This will help our efforts to contain the outbreak, and we are truly thankful.

A CDC medical officer demonstrates the correct procedure for health-care workers to put on protective equipment. He is using the protocol recommended by Doctors Without Borders to prevent being infected with Ebola. (Jorge Ribas/The Washington Post)

Similarly, a suitable vaccine and treatment for Ebola could have helped prevent this outbreak from getting out of control. And, indeed, efforts to fast-track the development of a promising candidate vaccine could potentially help to bring this all to a swifter end, even if initially there were only enough doses to vaccinate health workers on the front line.

But while these are very much welcome developments, they are nevertheless responses to an outbreak already out of control. After all, military field hospitals would not be needed if adequate health-care services were in place. And, as Uganda has demonstrated after several terrible outbreaks, the key to preventing a major outbreak is a health infrastructure robust enough to be able to respond quickly and effectively when cases first appear.

Medical staff in Uganda now have the training and means to recognize symptoms and isolate patients immediately, and they have access to appropriate equipment and protective clothing. Similarly, social mobilization networks are in place to get information out to the people to reduce the risk of spread, while laboratory facilities can confirm cases swiftly. It is a highly effective setup that was created with considerable help from the U.S. Centers for Disease Control and Prevention, but it relies wholly upon having strong health infrastructure.

In Liberia, a country that never before had an incidence of Ebola, we were utterly ill-equipped and unprepared. What is so tragic is that, until this outbreak, Liberia had made significant progress in building up its public health systems. With help from organizations such as Gavi, the Vaccine Alliance, we have reduced childhood mortality by two-thirds since 1990, thanks largely to expansive immunization programs.

Much of that good work has now been undermined. Having worked its way through the cracks in our fragile health infrastructure, Ebola has effectively brought health care to a halt in Liberia, as people avoid seeking medical attention. There is nowhere to go. So, with the malaria season setting in and routine immunization programs stopped, even when this outbreak is over we must prepare for other diseases to take hold.

Yet, with Ebola having claimed the lives of 96 of our health workers and infected more than 209 others, recovering is going to be hard. This is a huge hit for a country that had barely 50 doctors to care for a population of 4.4 million at the start of this outbreak.

More than ever, we will be reliant upon assistance from partners such as the United States and Britain, and global health organizations such as the World Health Organization, UNICEF and Gavi, to help rebuild our health systems, invest in health facilities, staff and equipment and restore immunization levels. And it’s not just Liberia — any African nation with a fragile health system is potentially vulnerable to this terrible disease. After all, infectious disease knows no borders.

The United Nations has said it is going to take $1 billion to stop this outbreak. Of course, that’s our immediate priority. But at the same time, countries like Liberia need long-term investment to build up our health systems to prevent outbreaks of this scale from ever happening again. We owe it to the thousands of citizens and health workers who have so far lost their lives to be prepared.