AFGOOYE, Somalia – Armed with machetes, the men pushed their way through the densely packed rows of trees, emerging every few minutes with large bundles of green bananas over their shoulders.

A guard, cradling a Russian-made rifle, scanned the tree line for intruders as the men threw the bananas on a trailer before dashing back into the plantation for another load.

When the trailer was piled high with bananas, it was pulled by tractor to a warehouse, where the fruit was sorted and boxed for transport across Somalia and as far away as the Middle East.

After years of warfare that decimated an industry that was once the largest in Africa, the banana is making a tentative comeback in Somalia.

"Last April, we exported to Saudi Arabia for the first time in 23 years," said Kamal Haji Nasir, 30, whose father owns this plantation. "We are excited and hopeful."

For more than two decades, Somalia was the epitome of a failed state — a country rife with war, anarchy, famine, piracy and terrorism. Many of those problems persist, but the country has made some progress in the past few years.

Somalia elected a new president and adopted a constitution in 2012, bringing some stability and attracting pledges of aid from international donors. Somali pirates have largely been contained and the terrorist group Al-Shabab has lost its grip over many towns.

"By any measure, Somalia today is in a better situation than it has been for the past 23 years," said Nicholas Kay, U.N. special representative for Somalia.

Banana farming was brought to the country by Italian colonists in the 1920s. Soon, bananas became a staple of Somali cuisine, and farmers began exporting to Italy and the Middle East. With investment by Italian and U.S. fruit companies, the banana trade reached its peak in the 1980s.

In 1990, Somalia's banana exports were worth $96 million, according to Mohamood Abdi Noor, a former World Bank agricultural expert.

That all came to a halt when civil war broke out in 1991. The government collapsed, and Somalia became a battleground. The once-thriving banana industry fell apart.

As the security situation improved, banana farmers started to rebuild. They repaired irrigation systems, hired workers and security guards and set their sights on markets overseas. In 2011, they created FruitSome to market and export their bananas.

Response from Del Monte, Dole and fruit companies in the Middle East has been mixed. Dole is cautious about committing to Somalia.

"The Somali banana industry has potential," said Xavier Roussel, marketing director at Dole Fresh Fruit Europe. But, he added, "right now it seems difficult to develop any agriculture program in Somalia because of the local situation."

The banana farmers have had some success connecting with regional buyers, with help from the U.N.'s Food and Agriculture Organization. The FAO organized a conference in Dubai this year at which Somali businesses exhibited goods to an international audience for the first time in years.