The International Transport Workers' Federation wants Sri Lanka to release an ailing supply ship captain held for the last three years.

It says Ukrainian Gennadiy Gavrylov has been stranded in the south Asian country since June 2016, when he was arrested after the now-scrapped 1,476-dwt Avant Garde (built 1982) was seized by authorities.

The Avant Garde was hired to provide piracy protection and had firearms and ammunition on board.

The ship was said to have been forced into Sri Lankan territorial waters by authorities, where it was taken.

"He is a victim of criminalisation, and his continued detention is nothing short of a severe breach of his human rights," said Stephen Cotton, International Transport Workers' Federation general secretary.

"No seafarer, no family, should have to go through the experience that Gennadiy is going through. Over the past three years of detention, Captial Gavylov has been restricted from leaving Sri Lanka and prevented from earning a living."

According to local media, Gavylov collapsed in court in August 2017 after being told he would have a hearing the next March.

He was rushed to the hospital where he was diagnosed with triple vessel coronary artery disease.

Doctors have reportedly recommended open heart surgery and he currently takes 11 pills a day.

"His health is suffering, he desperately needs life-saving heart surgery, and his family is left languishing without his wage to support them," Cotton said.