How does a company operate in the midst of a full-blown epidemic? For ArcelorMittal’s iron-ore operation in Liberia, it means trying to protect not only itself but also the community around it.

Executives at ArcelorMittal’s Tokadeh iron-ore mine in Liberia could have been forgiven if they felt a sense of relief a week into July this year. An outbreak of Ebola in the region in late 2013 was showing signs of running its course. For six weeks the country had been Ebola-free. Since then a few new cases had popped up many miles away, but the company had taken aggressive steps to protect its workers, so executives weren’t worried.

ArcelorMittal had even survived an unrelated protest on July 3 by aggrieved local residents claiming they had received inadequate compensation from the company for property. The demonstrators had turned violent, ransacking facilities near the mine and torching property. The attack was scary, but the perpetrators were quickly arrested. Company executives exhaled.

Only days later, on July 9, Patrick Sawyer, a Liberian-American who consulted for Liberia’s Ministry of Finance and had also begun working as a public health manager for ArcelorMittal in April, informed his colleagues that his sister had died. Ebola was suspected, and later confirmed.

Sawyer claimed that he had had little contact with his infected sister, but ArcelorMittal referred him to Liberia’s Ministry of Health in Monrovia for 21 days of isolation and observation. Managers for the global steel giant, which kept paying Sawyer’s salary, stayed in regular contact with him during this period. They also quickly communicated the facts to avoid alarming workers.

For nine days, the company says, Sawyer repeatedly reassured ArcelorMittal that he was showing no symptoms of Ebola. He said he felt fine. Then he went silent. Two days later the company learned that Sawyer had left Liberia and traveled, by way of Ghana and Togo, to Nigeria. He arrived deathly ill at Lagos’s International Airport. Sawyer was rushed to a hospital, where he died three days later of Ebola. As terrible as his death was, there was a horrific coda: Sawyer had transported the disease to Nigeria, and the virus spread to 19 people there before it was contained.

The episode showed just how quickly—and insidiously—the virus can defeat the defenses created by the conscientious (ArcelorMittal, in this instance) and wreak havoc through a combination of epidemiological virulence and human frailty (in this case, Sawyer’s unwillingness to abide by the terms of his confinement). In a matter of days the company had moved from relief to having an employee become an international carrier of the disease.

This is a story about trying to survive and do business during an epidemic. Since emerging in Guinea late last year and then spreading into Liberia and Sierra Leone, Ebola has taken the lives of nearly 5,000 people, an official tally that is said to be just a third of the real figure. The predictions are dire: The World Health Organization estimates the number of infections in just Liberia and Sierra Leone could climb to 1.4 million by January. The World Bank projects the epidemic will gash a $32.6 billion hole in the impoverished economies of West Africa.

Nowhere has the outbreak been as devastating as in Liberia, a tiny nation that has so far lost some 3,000 souls, and where, in the heart of the hot zone, ArcelorMittal continues to run its mining operation. Even as Ebola hysteria has taken flight around the world, some 4,500 Liberians and 200 expatriates still carry on with the operations of mining, transporting, and shipping iron ore. It’s business as usual. Almost.

There are many risks to doing business in Liberia, but Ebola was not thought to be one of them. Previous outbreaks were limited to remote and relatively small populations in Congo and Uganda. No multinational company has ever had to confront an epidemic of this virulent disease before.

“It’s a classic black swan,” says Bill Scotting, CEO of ArcelorMittal Mining. “We all talk about potential black swans and challenge ourselves to think what could happen, but Ebola is a real surprise.” The epidemic has the gravity of a natural disaster, he says, but the terror it sparks causes many of the organizations that might otherwise rush in to run away. With 16 mining operations under his purview, Scotting is familiar with global turmoil. Earlier this year 278 of his employees were conscripted into the Ukrainian army; nine of them have been killed. Last year, in Mexico, a company executive was gunned down by a drug cartel. Still, he calls Ebola, which has consumed up to a third of his time in recent months, unprecedented.

ArcelorMittal is a juggernaut, with $79 billion in 2013 revenues—some 40 times the GDP of Liberia. It’s the world’s largest steel company, and it has operations in some 60 countries. The company arrived in Liberia in 2005 back when it was just Mittal Steel. It had grown quickly by gobbling up companies, including one that owned the remnants of Bethlehem Steel. Its voracious need for iron ore spurred its foray into Liberia, whose two bloody civil wars, the second of which ended in 2003, together claimed an estimated 200,000 lives in a country of 4.2 million. A year after planting its flag, the company acquired its biggest rival, Arcelor.

ArcelorMittal became Liberia’s first major investor after the war, and it spent $700 million to fix up a site that had been operated in the ’60s and ’70s by the now defunct Liberian-American-Swedish Minerals Co. The concession, which ArcelorMittal has leased from the Liberian government for 25 years, is vast. It spans three counties, from a port in Buchanan to a large territory around the mine in Yekepa, in the country’s northeast corner. One hundred and fifty miles of railroad, government owned but operated by the company, connect the two, making it impossible to travel from north to south across the country without crossing ArcelorMittal’s terrain.

The war had left little for ArcelorMittal to work with when it first arrived: The railway had been picked over by scavengers and overtaken by jungle. There was a ship rotting in Buchanan’s harbor. At Yekepa, squatters had moved into housing, and facilities had fallen into disrepair: To get an X-ray at the local hospital, patients were required to bring a gallon of fuel to power the generator.

ArcelorMittal finished refurbishing the mine in 2011 and now exports 5 million tons of iron ore a year from Liberia. That’s a relatively small quantity given that the company digs up 70 million tons of the mineral each year. But it’s working on a $1.7 billion expansion of the mine, which will triple its production. The project is crucial: ArcelorMittal is relying on Liberia for the ore expected to account for two-thirds of the mining division’s planned growth in 2015.

Ebola has shut borders. It has grounded flights. It has spread anxiety far beyond the reach of the virus. But ArcelorMittal is adamant: The company will stay in Liberia. Its wide range of measures and precautions has meant that so far, amid a terrifying epidemic, it has endured only one fatality. “There’s no Ebola management document to benchmark against,” says Lee Pokorski, who became the company’s head of global security in September, after a three-year stint advising it on security in Liberia. “We had to use trial and error. There’s not really been a lot of errors, but it’s a steep learning curve.”

In early spring, on the day he was named ArcelorMittal Mining’s global head of health, safety, environment, and security, David Vint saw an unusual report come over the transom. There was an outbreak of Ebola just 30 miles over the border in Guinea. Cases were also suspected in Liberia’s Lofa County, to the west. Vint’s first thought: “What is this?” Despite his title, he had never heard of the virus—another reflection of just how unlikely a threat it was at the time. Vint punched the name of the exotic-sounding disease into the Internet. What he found horrified him.

What scared Vint was just how many holes an Ebola scenario blew through the company’s emergency-response plans, especially as the company had brought on battalions of contractors for its mine expansion. The site of ArcelorMittal’s mine is a 500-square-mile area with an employee community embedded among 25,000 Liberians with no connection to the company. Meanwhile the concession, located at the northernmost point of Nimba County, shares a porous border with Guinea along which trade flourishes. At its heart is Yekepa, a city 20 miles from the Tokadeh mine, where the company’s headquarters, hospital, canteen, an open-air theater, and housing blocks sit on the eastern edge of town. Clearly it would be impossible to insulate the area from the virus.

Vint and his colleagues realized that protecting ArcelorMittal’s employees from Ebola meant protecting the surrounding communities as well. The company turned to International SOS, its medical contractor in Liberia. International SOS advised it to limit each facility to one point of entry and to procure hand sanitizer and thermal scanners (the pistol-shaped devices that register people’s temperatures when pointed at their foreheads) for each entrance. This guarantees that every person walking into an ArcelorMittal facility has a temperature of less than 99.5 degrees and thus is not contagious with Ebola. (A person might have the virus already but is not a risk for communicating the disease until a fever kicks in.) Those with elevated temperatures are sent to the hospital for examination. The screening comforted some foreign contractors. So far every person detected with an elevated temperature has had other ailments, principally malaria, rather than Ebola.

The biggest problem was a lack of information about Ebola. Rumors circulated among the local population that it was an organ-harvesting scheme or a ploy by the government to attract international aid. Expat employees, meanwhile, tended to become spooked by sensational stories on the Internet that were just as false. Still, skepticism was a problem. “The hardest thing was preparing for an outbreak that wasn’t here,” says Kleber Silva, ArcelorMittal’s head of iron ore.

For this reason, managers at ArcelorMittal consider Adriano Duse—or “Professor Duse,” as he is invariably called at the company—the best investment they’ve made. A South African expert in Ebola and other infectious diseases, he arrived in April and spent four weeks in Liberia, educating employees, health care workers, and community members about the virus. The sessions turned out to be improbable crowd-pleasers.

“He made us giggle,” says Ken Bradley, a member of the company’s health and safety team, who fondly describes an afternoon in the company’s open-air theater in which Duse managed to get his audience of middle-aged mining guys on their feet and doing hand-washing drills. Duse debunked common misperceptions—particularly fears over transmission via doorknobs and toilet seats—and left employees with the reassuring mantra that Ebola “is a virus you really have to seek out.”

Duse met regularly with ArcelorMittal’s leadership in Liberia and helped them craft a strategy for managing business as the outbreak evolved. The product of these sessions was a “trigger matrix,” an elaborate document that spells out a number of scenarios and corresponding alert levels to guide the company should such events arise.

The trigger events are not what you might expect. They have nothing to do with the number of Ebola cases in the country or their proximity to ArcelorMittal’s facilities. “It’s a given that people around you are going to get sick,” Duse explains. “When you start saying, ‘If you have two cases in a five-mile radius of your concession, you need to increase the alert level,’ that has all kinds of implications on business and operational decisions, and it doesn’t make any sense. Two, five, or even 100 cases mean nothing as long as you secure your operation and watch carefully for anyone sick in your workforce.” Instead, the triggers are external events, like a border closure or state of emergency.

Of course, at that point in the spring, “trigger events” were looking less and less likely. After tallying 13 cases, Liberia seemed to have contained the outbreak. “We all sort of breathed a sigh of relief,” says Scotting.

The company maintained its diligence—the thermal scanning continued, for example—but Ebola eased as a concern in the minds of many. When Liberia’s government ministers visited the company in the wake of the July demonstration, they grumbled about being made to have their temperatures taken to enter company facilities.

That sense of calm, as the world knows, would vanish quickly. The Sawyer case would help transform Ebola from what felt like an isolated, distant phenomenon into a global frenzy.

Because Patrick sawyer worked for both the Liberian government and ArcelorMittal, the company mostly avoided being linked to him in the media at the time. Sawyer’s death provided powerful, terrible evidence for any remaining Ebola skeptics. It also coincided with an escalation of cases in Liberia, which added urgency to the company’s plans to secure and Ebola-proof its facilities.

The tone changed palpably at ArcelorMittal Liberia—in big and small ways. Employees stopped shaking hands or even bumping fists (initially, an alternative). Jokes about Ebola ended; too many people were losing friends and family. One employee sought counsel from a company executive about whether he should postpone his wedding until it was safe to gather in groups. (He decided to delay the event.)

Along with twice-daily conference calls to its parent company in London, the Liberia offices began holding morning meetings where employees could share Ebola-related information or raise questions. That sounds elementary, but most local staffers don’t have email or the means to obtain reliable information. The meetings became an important forum for understanding the disease and what was going on.

They also became a good way to keep tabs on employees. Sawyer’s case validated the company’s decision to monitor workers with even the slightest connection to an infected person, and it provided lessons on human behavior. The company now distributes questionnaires, and employees are asked to report signs of illness or contact they’ve had with Ebola patients. They’re also asked to share any concerns about one another.

The company takes this policy seriously. “We’re very clear we need the truth,” says Silva. So far the company has placed just 18 additional people under observation. The first 15 employees have been fine and returned to their jobs after 21 days; three remain in quarantine. (ArcelorMittal is also fighting the stigma that surrounds Ebola. When employees return after their observation period, they are publicly welcomed back at one of the daily meetings by the CEO and given a letter of thanks from Silva.)

In July, ArcelorMittal redoubled its efforts to Ebola-proof its concession, along with a 30-kilometer buffer zone. Community liaison workers were dispatched to 50 communities to lead Ebola training, as were ArcelorMittal schoolteachers when the outbreak led the government to close schools in July. They have seen progress: Vigilance has replaced skepticism. ArcelorMittal has managed to develop trust and strong information networks in the process. Members of the local population will sometimes report a suspected Ebola case to the steel company before they call the health authorities.

The company also gets good intelligence from the government, largely because of the efforts it has made to support the authorities. (The company has been on Liberia’s Ebola task force since the outbreak started.) ArcelorMittal recognized many counties lacked the capacity to control an outbreak, particularly the contact-tracing teams who can identify and monitor suspected Ebola cases. So the corporation funded a project to provide such teams.

At the same time, ArcelorMittal started mapping and zoning the residences of its staff and local contractors to pinpoint which employees are most at risk. It hasn’t been easy: Street addresses and even town names aren’t standardized in Liberia. There are six spellings for “Yekepa,” for example.

Even as the company ramped up, by August the crisis effectively shut down the Liberian government. Virtually the entire civil service was told to stay home for three weeks, and many are still on leave today. The company had to find ways to move iron ore and supplies through its port despite the dearth of customs inspectors. In mid-August, Liberia declared a curfew. ArcelorMittal, which moves its ore around the clock, had to obtain special permits for its vehicles.

Even basic logistics became daunting. Before Ebola, the company imported bananas, plums, meat, and other fresh goods from Guinea. With the outbreak, rumors surfaced that rotten plums could spread Ebola. There was a similar scare over various bushmeats. The company determined there was no threat, only to see the supply from Guinea stopped for another reason: The border was closed. ArcelorMittal turned to Monrovia, but there was no food to be had. Now the company has to spend large sums to charter planes to bring in enough fresh food to sustain personnel in the event of, say, a 72-hour Ebola lockdown (which has been tried in Sierra Leone, but not Liberia).

Add to this puzzle the worst-case scenarios that the company has to plan for—such as another case of Ebola among its employees. ArcelorMittal has temporary isolation wards and Ebola treatment centers, but in the case of an infected expat, the ideal course would be to evacuate the employee to his or her home country. Accomplishing that involves precise timing and getting approvals from the receiving country’s government—and even the nations the plane has to fly over. Such an operation has grown even trickier to arrange as nations introduce quarantines and become resistant to receiving persons who have come from West Africa. “Every day the situation changes,” says Dr. Andre Willemse of International SOS, which is handling much of this process for the company. “It’s become very complex to fly out any patient with a fever. With Ebola it’s a whole new ballgame.”

The biggest blow to ArcelorMittal’s Liberia business was not the July attack on its facilities, nor the death of one of its employees, nor even the worrisome rise of cases near its concession. What actually interfered with business was a series of announcements in August.

On Aug. 6, Liberia declared a state of emergency. ArcelorMittal contractors, most of them involved in the mine’s expansion, rapidly invoked the force majeure clauses in their contracts, which allows them to break the agreements. Some 2,400 of the company’s contractors flooded out of the country within days. The impact of the departures was immediate: The expansion project was mostly halted, though enough employees remained to keep the mine in operation.

Then, on Aug. 17, Kenya Airways announced it was suspending flights to and from Liberia. The decision came on the heels of a similar announcement by British Airways.

Cancellation of flights is an event on ArcelorMittal’s trigger matrix—the development raised the company’s alert level to red—and caused it to fly 130 expats home. Though the connection may not be obvious, the implications of the airlines’ decisions were significant: Without those flights, there was no way to ensure there would be enough airline seats to get all of the company’s expat employees out of Liberia in the event of an emergency evacuation. The flight cancellations also complicated routing and raised the cost of sending various expats out on “rest and relaxation,” which is required every six weeks. (As of today, BA will not fly to the country until at least March; Kenya Airways has not stated what it plans to do.)

Morale is of course one thing not addressed by a trigger matrix. Local employees are losing loved ones and living with greater risk of becoming infected. They fear ArcelorMittal will pull out of Liberia. Silva, the company’s chief of iron ore, has increased his trips to the country for just this reason. He says that the company’s Liberian workers are pleasantly surprised every time he comes back.

Expats, on the other hand, describe a loneliness that set in after the evacuation of their colleagues and the pressure from families to come home. (They say the loneliness is tempered by an intense bond among those who have remained.) ArcelorMittal has created a hotline for family members wanting to speak with a medical specialist. Meanwhile, because public gatherings are discouraged, fun has pretty much stopped at the company’s site. Says Tom Grant, who works on the company’s community-mapping efforts in Liberia: “It’s work, eat, sleep. Work, eat, sleep.”

When things were at their most chaotic in the middle of the summer, ArcelorMittal began calling competitors in the region. “We all felt a little bit helpless,” says Joseph Mathews, the company’s head of government affairs. “At first it was really just to see, Are we doing the right things?”

The company has long realized that the government’s capacity was stretched and that it had a supporting role to play. In July its Liberia staff began calling local NGOs and asking what they needed. After filling requests for gloves, chlorine, and personal protective equipment for a while, the company more or less flung open its storehouse doors to organizations working on the outbreak. Now it essentially allows them to take what they need.

ArcelorMittal has paid to refurbish hospitals, donated ambulances, and provided generators to power the country’s Ebola-testing labs. It has housed aid workers and bulldozed land to make way for mobile hospitals that the American Army plans to construct. It has teamed with International SOS to get thermal-scanning devices for the country’s international airport and its port. The corporate group led by ArcelorMittal has grown to 70 companies, including Firestone, the only other multinational with a large presence in the country, and is now working to coordinate and prioritize donations.

Pokorski and team now take Ebola as a given. They are focused on creating conditions that can safely accommodate the 2,700 additional personnel and contractors needed to resume the expansion project. That means ringing facilities with razor-wire fences, building more isolation wards, and testing emergency-response plans to see whether they’ll hold up under the pressure of a larger workforce.

Mining chief Scotting has begun to talk with some of the company contractors who left the country, and he says the response has been positive. Some might re-up, even at a time when there are far more Ebola patients in Liberia than there were when they left. It’s hard to imagine, but the outbreak is approaching its first anniversary. ArcelorMittal has done an impressive job of protecting its employees under trying circumstances. The company has built its levees 20-feet high, so to speak; now it has to hope they hold.

This story appears in the November 17, 2014 issue of Fortune.