The sailors were arrested last week by Somali coast guards. Nine of the 14 were present in court yesterday.
"The court sentenced 14 Indian sailors and a Somali woman" who was the owner of the charcoal, judge Hashi Elmi Nur told AFP, adding that the sailors could avoid serving the prison term by paying USD 10,000 (7,500 euros).
In their defence, lawyer Hassan Abdule Farayare argued that because the charcoal had been exported from zones controlled by Islamic insurgents, the court was not competent to try the case.
"The boat and the crew members are not guilty because they exported charcoal from areas the government does not control," he said.
It was the first time that a court had tried foreign nationals for illegally exporting charcoal. Charcoal is an important source of revenue for the country's Al Qaeda-linked Shebab rebels, which control Kismayo, the biggest port in the south of the country.
According to Andrew Mwangura, who heads the East African Seafarers Assistance Programme and closely monitors illegal maritime activity in the region, charcoal is one of the main commodities transiting through Kismayo.
He estimated that the Shebab derive monthly revenue of approximately half a million dollars from berth, import and export taxes in Kismayo alone. Several other ships carrying charcoal are also believed to leave Somalia from the port of Barawe, further north.
Most of the charcoal smugglers use Indian dhows to take their cargo to Gulf states, notably the United Arab Emirates where the import of charcoal is not banned.
While charcoal exports have become a significant source of income for the Western-backed Somali government's insurgent enemies, charcoal burning has also caused huge damage to the environment.
The resulting deforestation has complicated livestock herding in some regions and further exposed the population to the impact of droughts.