Afghans are observing two days of mourning for victims of the communist government in the late 1970s. Many were conservative and Islamist opponents of the government or supporters of rival communist factions.
The BBC's Lutfullah Latif, who was one of those held in the notorious Pul-e-Charkhi prison, recalls what happened to him.
It was November 1978, I was a newly qualified doctor working at the Ministry of Health in Kabul.
One afternoon three officials came to tell me that I was wanted for questioning at the Interior Ministry.
I knew that I might be in difficulty, because I was politically active as a student, and at that time a lot of people were arrested by a government that was suspicious of everyone.
But I didn't realise that this was the beginning of a 13-month ordeal that has stayed with me ever since.
For the first week I was questioned every night at around midnight.
They always asked the same thing 'Who are the people plotting against the government?', 'Have you ever been involved in secret meetings?', 'Who are your leaders,? What are their plans?'
I had no idea what they were talking about.
One night they brought in a small machine for generating electricity. It had a handle on the side and wires that they connected to my toes.
They turned the handle and started giving me electric shocks. Every time they turned the handle faster the shocks got stronger and stronger.
They kept on doing this night after night, until one of them said to me: "Look, unless you write something down - anything, you're never going to get out of here." So I made up something for them, of course not accusing anyone else. A week later I was taken away.
I thought I was being released but in fact I was being transferred to Pul-e-Charkhi prison.
'Worse than medieval'
I was put in a big room. There were about 120 people being held here. I recognized some of them - doctors, government officials and university students.
There was just enough space to lie down on the floor. Each person was given two blankets and that was all.
In the corner there was a small space that we kept free. We took turns to stretch our legs there because 120 people can't all walk up and down at the same time.
We were only allowed breaks twice a day. They would take us outside and we could walk in the yard.
Living conditions were worse than medieval. There were no sanitary facilities or running water. Just an open tank of water and some buckets.
The toilets were wooden boxes on top of holes in the ground. Hundreds of prisoners would line up just to use the toilet. We would spend the whole break just standing in the queue.
You couldn't eat the food because you could get sick, so most people relied on dry bread and tea from the prison canteen.
My family had no idea where I was. They told me later that they kept coming to the prison gate to find out what was happening. After three weeks they were finally allowed to send me some clothes and money.
Four months after I was arrested the president was killed and replaced by his deputy. A new prison governor was appointed and for us things began to change for the better.
We were allowed to go out into the yard more often. We had access to newspapers and they even put a small television set in our room.
Night time executions
They were trying to show us that the political system had improved; but in fact what we were hearing from the outside was that lots of people were being arrested and executed.
One day a group of about 200 prisoners were taken away and soon after we heard gun shots outside the prison gates.
We heard rumours about people being taken to the waste land outside the prison and executed. Later on, much later, graves and bodies were found there.
Sometimes at night, the prison governor would burst into our room. He was obviously drunk. He had a big stick in his hand and a pistol.
He would start lecturing us about how all the enemies of the government would be eliminated. We all had to clap, and anyone who didn't got a beating.
One time a prisoner right next to me fell asleep. The governor noticed and grabbed hold of him.
He beat him up so badly that he broke his ribs and his cheek. He was covered in blood. They took him away and we never saw him again.
In December 1979 the new president was overthrown by the Soviet army.
We started hearing gunfire at about 8 o'clock in the evening. It got heavier and heavier and at 10 o'clock soldiers overpowered the guards and stormed the prison.
We saw Russian and Afghan soldiers running through the corridors. They came into our rooms and told us 'you'll be freed tomorrow'.
The next day they brought buses and took us all into the town centre where we were released. I got a taxi home with my cousin who had been arrested after me.
When we got there my cousin said to my mother, 'Look who I've brought home. I told you I would go and find him!"
Dr Lutfullah Latif is editor of the BBC's Afghan services.