Kings Nehemiah Okoye, a Nigerian marine engineer, has been a seafarer for 25 years. In 2010, while working for the Shell oil company, he was kidnapped by pirates off the coast of Nigeria. Less than two years later he was kidnapped again, this time by Somali pirates. This is his story.
I was first attacked on 1 October 2010. Nigerian pirates killed all 16 of the military personnel who were escorting our vessel, then they boarded our boat, stole all our property and vandalised everything else.
They sailed the ship back to Nigeria and took us into the forest where they held us for four days. They beat us and made us lie down so they could stand on us and march over our bodies. They said they hadn't come to kill us, but to take our oil. After they had siphoned off all the diesel from our ship, they left. I was free.
Less than two years later I was attacked again, this time by Somali pirates.
I was on board a chemical tanker about 150 nautical miles off the coast of Pakistan. It was 28 February 2012.
It all happened so suddenly - I was down in the engine room when about 12 of them climbed on board with a ladder. They were shooting everywhere and forced us at gunpoint to sail the ship to Somalia. It took six days.
As soon as we got to Somalia, the pirates asked us to contact the owner of the ship to start ransom negotiations.
We were held hostage on the boat for more than a year. The pirates had a special negotiator called Mursal who would come in from Kenya every month or so. I helped negotiate on behalf of the company because the ship owner was Nigerian.
At the beginning, they asked for $25m but the ship owner said he didn't have that kind of money. In the end, I think they settled for about $1.5m.
Sometimes Mursal acted as if he was my friend and he often used to ask me if I could get him a job in Nigeria once the ransom was paid and we were freed. "Maybe you can learn how to drive and become a bus driver in Nigeria," I told him. "It's better than carrying guns."
At first the pirates kept us on the bridge but they moved us after the death of the engineer - a fellow Nigerian who was a close friend.
The pirates were very, very rough. Sometimes they tied me up like a goat. Sometimes they beat me until I became unconscious. "Let's beat this man because he is a Nigerian," they said. "If we beat him, he will tell the owner of the ship and he will pay the ransom." They did not beat the Indian, Bangladeshi or Pakistani members of the crew.
The pirates brought lots of different guns on board and used our boat as an armoury. They made me weld big guns on to the ship and they would fire them at any other boat that approached us.
When they did this, they told us to go and lie down in the cabins so we wouldn't be hit by stray bullets. When they thought another pirate group was planning an attack, or a naval patrol was in the area, they would make us move the ship - we did this at night.
After about two months, many of the hostages fell sick so the pirates organised for a doctor to come all the way from an Arab country - I don't know which one, but he spoke only Arabic. He checked all of us, and gave medicine to the sick. He told me my blood pressure was high which didn't surprise me.
The doctor wasn't the only foreigner to visit us on the ship - others came on small boats from Arab countries, about every two months, to deliver food. The pirates told us they had given these people a contract, and that when they got the ransom payment, they would give them a share.
Food was a big problem for me. The pirates didn't have Nigerian food. They had only rice and flour, which the Asian hostages were used to, but not me. The pirates told us to be very, very careful with the food, because there wasn't much of it - otherwise we would starve.
A young Indian member of the crew was very clever and managed to hide his mobile phone from the pirates. One day, he noticed that the pirates' cook misplaced his SIM card, so he took it and put it in his phone - for a while, we were able to speak to our families.
But it was difficult for me because when I told my wife what had happened, she fell sick and had to be hospitalised.
I was not able to think normally whilst I was being held. The only thing that gave me comfort and courage was my Bible but the pirates, who were Muslim, hated seeing me reading it.
It was the same when I tried to speak to them - they didn't speak English and when I said "Good morning", they thought I was insulting them, so I decided to only communicate with hand movements. It was different with the Nigerian pirates because at least we shared a language.
It got to the stage that I thought I would try to harm myself and die. I used to think of jumping into the sea so that I would drown.
Sometimes the pirates gave me the narcotic leaf khat, which they liked to chew, and then I would forget myself. It made me feel I was no longer in bondage and I would even laugh with the pirates. Sometimes there were as many as 60 pirates on board that ship.
The day I was freed was truly wonderful. At around 21:00 one evening we were told, "You can start your engine and go. You are free." We couldn't eat because of the joy. Even breathing the free air wasn't easy after those 13 months in captivity.
When I eventually got home to Port Harcourt in Nigeria, we had a survivor's party. My friends and family were jubilating but I didn't feel that happy because I kept thinking about my close friend, the engineer, who had died on the ship. I kept thinking about his family.
After I was freed, I found one of the pirates on Facebook. His name was Mohamed - I wrote to him advising him to change his ways but he never replied.
Somali pirates do what they do partly because of the poverty in their country. But poverty does not explain the level of violence our kidnappers used. It's because they hadn't been to school, they had never even heard of school so they were like animals. An educated person would be able to put himself in the other person's position and would not act like they did. But these pirates didn't think like that because they have fought for generations.
I have not been able to find work since I was freed in March 2014. I am owed 14 months' salary but the ship owner hasn't paid that, let alone compensation. I am finding it difficult to survive. My family want me to stop going to sea but I'm looking for work as a marine engineer. I like sea work. I can't help it.
More from the Magazine
Judith and David Tebbutt were on holiday in Kenya when they were attacked by a group of armed men. David was murdered and Judith was taken to Somalia where she was held hostage for six months. She told her story to Dan Damon.
Kings Nehemiah Okoye was speaking to Mary Harper.
Subscribe to the BBC News Magazine's email newsletter to get articles sent to your inbox.