Jan 10 (Reuters) - Ecuador dispatched security forces to its main port terminals and to some key transportation routes for fruit and cocoa in the country to allow export operations to continue, exporters said on Wednesday.

Ecuador is the world's largest exporter of bananas and the third largest global producer of cocoa, the chocolate-making commodity. The family of President Daniel Noboa has a large banana exporting business.

The country has been rocked this week by violence coming from criminal gangs linked to drug trafficking. Noboa said on Wednesday that the country is at war with the gangs.

He declared a state of emergency on Monday.

Port operations in the main export hubs such as Guayaquil, Posorja and Manta, continued normally despite the violence in several cities, said the head of the banana exporting group AEBE, Jose Antonio Hidalgo Molina.

He said the group has been working with the government to create safe corridors for the fruit to be transported from the farms to the ports.

Some companies operating with agricultural commodities were not fully staffed on Wednesday, said Hugo Francisco Hernandez, a director at cocoa exporting group Anecacao, as many people are avoiding commuting to offices.

But loadings at ports have not been impacted yet, he said. (Reporting by Marcelo Teixeira; Editing by Sandra Maler)