Nilson was born and grew up in a peasant region in Skåne, the southernmost province of Sweden. He became a construction worker in 1906, by which time he had already become a class conscious young socialist.
In the summer of 1908 the workers in the docks of Malmö went on strike for better conditions. The police and military were called in to keep order, and the employers took in British workers to do the job. This was considered highly provocative by the striking Swedish workers.
The British workers were temporarily living on a ship called Amalthea. On the night between 11 and 12 July, three young unemployed workers, including Anton Nilson, put a bomb outside Amalthea, supposedly meant to scare. The bomb exploded, killing one and wounding 23 of the British strikebreakers, who were sleeping on the deck rather than in their cabins. The name of the Englishman killed by the explosion was Walter Close.
Anton Nilson was sentenced to death. His two accomplices Algot Rosberg and Alfred Stern were sentenced to penal labour for life.
Before his execution, Anton Nilson was pardoned and, like the others, given forced labour for life.
The first reactions in Sweden to the bomb attack on the Amalthea were those of horror and disgust followed by condemnation, including from the workers movement. However, after a while public opinion sided with Anton Nilson, Algot Rosberg and Alfred Stern, and a massive campaign was launched to have them freed. Thousands of international meetings were held in their support, including some 600 meetings amongst workers in the United States, organised by the Industrial Workers of the World and with Joe Hill as a leading participant.
A petition containing some 130,000 names was handed to the government and Supreme Court of Sweden, asking for the release of the three young men.
An attempt to free Anton Nilson by force from the prison in Härnösand took place on May Day 1917, when 10,000 workers marched to the jailhouse. Guards with machine guns were stationed on the walls and the military was called in. The prison guards were ordered to shoot Anton Nilson if necessary rather than letting him escape. Eventually the masses demonstrating outside the prison gave up and walked away.
Finally, in October 1917, Anton Nilson and the two others were pardoned. It was the first decision made by Nils Edén's appointed coalition government of Liberals and Social Democrats, which under the following two years would institute democracy and women's suffrage in Sweden.
As Anton Nilson was released from jail, the Bolshevik Revolution had just started in Russia. Without hesitation, and nowhere else to go, Nilson went to visit Russia in company with the Swedish communist leader Ture Nerman.
Anton Nilson decided to join the Red Army, fighting as a pilot in the civil war. Nilson helped organize the air defense of Moscow, later taking command of the air force on the Baltic Front. For his services his comrades elected him to receive an award from Leon Trotsky.
At the rise of Stalinism, Anton Nilson decided to return to Sweden in 1926. He would always consider Stalin as a traitor to the revolution, saying: "Stalin took the state police, which had been formed against the counter-revolution, and turned it against socialists...." and an adherent to the fascist model of a police state. His departure from the Soviet Union may as well have saved him from the Great Purges during the 1930s.
When Nikita Khrushchev took over the leadership of the Soviet Union after the death of Joseph Stalin in 1953, Anton Nilson considered it a positive development.
For the rest of his life, Nilson toured Sweden agitating for Swedish Communist rule. He also became revered as one of the Swedish Labour Movement's heroes and his portrait is to be found at the headquarters of Landsorganisationen. His 100th birthday, during which Anton Nilson himself held a speech lasting for several hours, was celebrated by several Social Democratic members of the Swedish Cabinet.
Anton Nilson lived to be 101 years old. Although he expressed "regret" at his trial that he had killed and injured, he is not recorded as ever having apologised to the injured, or to the family of the dead English worker.