The horrific kidnapping of nearly 300 Nigerian school girls has directed global attention to Africa's largest economy.
Nigeria has been one of the hottest destinations for foreign investment in the developing world in recent years. Big companies and investors have been attracted to the country's booming economy, abundant natural resources and rapidly-expanding middle class.
But the fact that militants from Boko Haram were able to carry out their brazen attack on a boarding school could scare away Western investors. Clearly, security is still a real threat.
"The government has proven unable to prevent large-scale bombings and incapable of curtailing activities of Boko Haram in northern cities," said Geoff Porter, head of security consultancy North Africa Risk. "I don't think Nigerian security forces have a grasp on what's taking place."
So far, Nigeria's economy appears to be withstanding the security conundrum. Stocks have barely dropped since the abductions last month, and Western companies have not announced plans for a mass exodus.
But Nigeria must watch investors' willingness to make commitments going forward.
More than $21 billion of foreign direct investment poured into Nigeria in 2013, up 28% from the year before. The country has attracted the most foreign direct investment in sub-Saharan Africa since 2007, according to Ernst & Young.
It's not just energy firms. Western companies sinking cash into Nigeria include General Electric (GE), Procter & Gamble (PG), Yum! Brands (YUM), Hugo Boss (BOSSY), Nestle (NSRGF), Siemens (SI) and SAB Miller (SBMRF).
Nigeria has been diversifying its economy away from energy and subsistence agriculture. The nation's GDP is now $490 billion, just shy of the economies of countries like Norway and Sweden.
But this bullish backdrop is being threatened by Boko Haram, the Islamist group behind the massive kidnappings. Their four-year insurgency has cost more than 4,000 lives, destroyed countless schools and government buildings and displaced almost 500,000 people, according to the International Crisis Group.
Related: Drug cartels are ruining Cinco de Mayo
'Bipolar view of Africa'
Unless the government implements "comprehensive plans to tackle not only insecurity but also the injustices that drive much of the troubles, Boko Haram, or groups like it, will continue to destabilize large parts of the country," the organization said in an alert issued last month before the kidnappings occurred.
Boko Haram, which the U.S. government has deemed a terrorist organization, controls parts of northern Nigeria, terrorizing citizens by burning down villages and executing abductions like the ones that have captured international attention.
Investors were already grappling with a myriad of challenges in Nigeria, which receives low scores from independent organizations on ease of doing business, corruption and access to electricity.
"Nigeria produces a pitiful amount of power," says Roddy Barclay, senior analyst at global risk consultancy Control Risks. He believes the lack of electricity is "a major impediment to get foreign investment."
Related: U.S. seizes $458 million stolen by Nigerian dictator
On the other hand, the country's relatively robust legal system and well developed banking system are appealing.
"Nigeria epitomizes this almost bipolar view of Africa," Henry Egbiki, West Africa regional leader at Ernst & Young, wrote in a report last week. "For many of us already doing business on the continent it is an exciting, dynamic, high octane growth market; for some others, often on the outside looking in, it seems chaotic, unstable, and uncertain."
"The reality is obviously less cut and dried than either of these extremes," he wrote.
The questions about security overshadowed the positive growth story that Nigeria wanted to promote when it hosted the World Economic Forum last week.
The situation has been exacerbated by Nigeria's limited security infrastructure and military corruption. An American official told CNN that six U.S. military advisers arrived in Nigeria on Friday to help in the kidnapping rescue efforts, adding to the American counterterrorism presence already in the country.
Will investors flee?
In the short term, the impact on foreign investment in Nigeria is likely to be dictated by geography.
Porter said the security situation may cause investors to yank money from manufacturing and infrastructure investments in northern Nigeria, which has been ravaged by violence.
For the most part, Nigeria's resource rich southern region has been spared from violence, insulating investments in the oil and gas industry from the likes of GE.
Perhaps that explains why Nigeria's stock market has largely withstood the recent turmoil. The Nigerian benchmark equity index has only declined about 1% since the kidnappings in mid-April.
"It remains one of the most challenging investing environments around, but the opportunity and rewards are such that investors are generally looking at Nigeria as a viable investing environment," said Barclay.
But that doesn't mean a security solution is necessarily in sight. Observers believe the violence may escalate ahead of key elections next year.
The flow of investment into Nigeria could be disrupted if militants begin targeting Westerners, provoking a more forceful military response from the U.S. and Europe. Porter warned that could result in a "backlash against Western" brands who have just begun gaining a foothold in Nigeria.
"It's a huge challenge, and it isn't going to be resolved overnight," he said.