The Afghan man was also ordered to pay 50,000 francs in damages to each of his three children, who are now living in care, reported news agency ATS.
The case dates to November 2015 when a row broke out between the man and his 30-year-old wife in their apartment in Gipf-Oberfrick, in the canton of Aargau, while their children – aged 6, 9 and 11 – were at school.
The man beat and tried to strangle his wife before she fled into the garden. He pursued her with a kitchen knife and stabbed her 56 times, the court heard.
A neighbour came across the scene and called the police, who found the woman dead in the garden.
The president of the Laufenburg district court called the act a “massacre” and said the man was a “predator who hounded his prey until she died”.
After initially denying the facts, the accused later admitted he killed his wife but said he didn't intend to.
From Afghanistan, the family arrived in Switzerland as asylum seekers in 2011. Their request for asylum was refused but they remained in Switzerland on a provision basis for humanitarian reasons, said ATS.
The woman and their children were well integrated but not the man, according to the court.
Police had been called to the family's home several months before the murder, when the man had threatened a neighbour with a knife.