The man was acting strangely even before he boarded the plane, hunching over in pain and avoiding physical contact with other passengers milling around the airport in Monrovia, Liberia's capital. Once airborne, he was sick several times. By the time he disembarked at Lagos airport – one of the busiest in the continent – he was no longer able to stand unaided, diplomats and a witness told the Guardian.

Those who rushed forward to help did not know Patrick Sawyer was in the final stages of an Ebola-induced breakdown, when the deadly disease is at its most contagious. More than 24 hours passed before the Liberian-American civil servant was diagnosed, allowing the virus to gain a toehold in Africa's most populous city and, for the first time, turning the threat of an urban outbreak into a nightmarish possibility.

After watching three regional neighbours - Guinea, Liberia and Sierra Leone - battle an eight-monthepidemic, Nigerian officials are scrambling to contain a potential fourth frontline.

Nigerian custom officers wearing face masks and gloves screen passengers arriving at Nnamdi Azikiwe International Airport in Abuja this week. Photograph: Afolabi Sotunde/Reuters

On Wednesday, the World Health Organisation said the number of confirmed, probable and suspected Ebola cases had grown to 1,975, with 1,069 deaths. The German government called on its citizens to leave Guinea, Liberia and Sierra Leone because of the epidemic.

A colleague travelling alongside Sawyer and a nurse who treated him have both succumbed to Ebola. At least eight others have caught the disease in Lagos, and some 200 are under surveillance.

"There are some unique challenges that have come up," said John Vertefeuille, leading the US Centers for Disease Control and Prevention (CDC) response team in the city. "The population density is a challenge and it's one we're looking at closely in terms how you do contact tracing. What Lagos has as strengths is there's a really talented workforce to draw on."

Oil giant Nigeria has more resources than most to handle an outbreak but whether the situation spins out of control hinges on the Herculean task of tracing contacts in a crowded, freewheeling city of transients. It took 10 days to trace Sawyer's driver to Port Harcourt, a densely-populated city 600km south of Lagos.

Liberian nurses carry the body of an Ebola victim from a house for burial in the Banjor Community on the outskirts of Monrovia, Liberia. Photograph: Ahmed Jallanzo/EPA

The incident has also highlighted a deeper culture of neglect when it comes to infectious tropical diseases that ravage West Africa each year.

So far, much has come down to chance. As a diplomat, Sawyer, 40, was whisked from the airport by a private driver. The company car – in which he was again sick, according to a Nigerian health official – was taken to a diplomatic compound, and was not used again because it was a national holiday. But public health workers were on strike, so Sawyer was taken to a small family clinic. There, the team who tried to save his life did not initially suspect Ebola, or work with protective gear. At least one other patient at the clinic would later catch Ebola.

"The family hospital Sawyer went to was caught unawares. If it had been a public hospital, we would have had a much better chance of containing it," said John Oladejo, of Nigeria's Public Health Department, which in April sent dozens of doctors on an Ebola training course.

Nigeria has one doctor per 2,879 people, compared with one per 10,000 in Guinea or one per 86,275 in Liberia. "We have a window of opportunity at the moment to contain it but there's no room for letting down your guard," said Chikwe Ihekweazu, an epidemiologist who helped stem an Ebola outbreak in Sudan a decade ago. "It's not that we don't have the resources. The challenge is that there are things you have to do religiously every time you're dealing with a patient, and we're just not used to that level of diligence in Nigeria."

An Immigration officer checks a passenger's passport at the Nnamdi Azikiwe International Airport in Abuja. Photograph: Afolabi Sotunde/Reuters

On the noisy downtown street where Sawyer was initially hospitalised before being moved to a specially-built isolation ward, hardware salesman Emmanuel Uju sat on a ladder balanced over an open sewer which runs past his house. "I don't shake anyone's hands any more, but I truly have faith it won't spread more. They said you just need to separate the affected people to stop it spreading," he said, as yellow tricycles squeezed past cars, roadside food vendors and men wheeling barrels of water.

Border controls – which have helped in seven previous Ebola outbreaks – are unlikely to do so in Lagos, whose population ebbs and flows with up to 4,000 new migrants each day. "Ten years ago in Sudan there were no mobile phones, no Twitter. We drove around in Land Rovers with microphones telling people what to do. Today we really need to think about how to communicate with the public so that they know what to do without creating panic and anxiety," said Ihekweazu, who runs the health information site nigeriahealthwatch.com.

Another site set up within 24 hours of the first confirmed case, EbolaFacts.com, received 600,000 hits and 850,000 Facebook views within a week.

But technology is a double-edged sword. Yahya Balogun woke up to a 4am call last Friday. On the line, his mother demanded he stock up on salt – she had received a text message circulating with the "cure" of a hot salt bath before dawn.

"Two hours later she called again and asked, 'Yahya, have you done what I asked? Have you sent all your friends the message? This is a terrible disease and you need to pass on the advice'," the taxi driver recounted. The rumour prompted two deaths this week from overdosing on salt water.Public health officials worry fear-mongering will distract from the simple solutions needed to prevent contagion, in scenes reminiscent of some of the scare tactics amid an outbreak of the then little-understood HIV virus in the US during the 1980s. This week an epileptic man reportedly died after residents in Edo state thought his convulsions were a symptom of Ebola and refused to help.

"We see the fear in people's faces when we're going around door-to-door tracing contacts in the community. You have to explain to each person that there's nothing to be scared of – the likelihood of survival is much higher if you come forward in time," said Oladejo, the public health official.

"When they ask, what about the Liberian, we tell them: that's exactly what he didn't do; he didn't come forward."

President Goodluck Jonathan has declared a national emergency, and approved a 1.9bn naira special fund. Despite outbreaks of cholera and Lassa fever – a similarly deadly haemorrhagic fever – that kill tens of thousands annually, the country has no adequate isolation units, so officials rushed through orders for special tents and protective suits essential to prevent contagion.

Ebola's rarity means it is often overlooked globally too. Fewer than 300 Ebola specialists are stretched thin on the ground in three other nations.

"I just hope all our work is not in vain," Oladejo said.