MEA spokesman Syed Akbaruddin confirmed James' release, along with the release of another sailor identified as Vijayan, and said that the two sailors would be put on a flight for India today.

In a rare piece of good news for the grieving family of captain Captain Sunil James, the Indian merchant navy captain has been released from prison in Togo.

Speaking to CNN-IBN, MEA spokesman Syed Akbaruddin confirmed James' release, along with the release of another sailor identified as Vijayan, and said that the two sailors would be put on a flight for India today.

"This has been a very difficult process for the Indian government, and the incident is not over", he said.

He added that the Indian government had fought a difficult battle in a 'far off place where there was no permanent representative'.

Akbaruddin said that there was no chance of James being taken back from India, saying "Home is always a permanent place for any Indian".

The sailor who was arrested on charges of aiding piracy, on charges of aiding pirates off the coast of Togo, had been languishing in jail since July. In further tragedy, his 11-month-old son Vivaan died of septicaemia in a Mumbai hospital.

According to CNN-IBN Foreign Affairs editor Suhasini Haidar, the case was all the more difficult because a judicial process had been in place, and because the Indian government had to first get all the details of the case. Furthermore, Captain James had been on a private ship that made things more complicated.

Speaking to CNN-IBN, James' sister-in-law said that he had been released at around 2.30 am and said that the government's action in the case was highly commendable.

His family had moved the foreign ministry, asking that he be brought home to attend the child's last rites.

The case generated massive outrage when it was made public in the media, with the Indian government slammed for what was perceived to be its utter disregard for the welfare for its citizens.

The Indian diplomatic machinery then swung into action.

An Indian consular official met James in prison earlier this month, and in a meeting with his family, Prime Minister Manmohan Singh promised that the government was doing 'everything possible' to secure his release.

External affairs ministry spokesperson Syed Akbaruddin had also said that "India is pursuing the matter very seriously (for the release) and will try its utmost to see that the family is reunited in its difficult times".