A white supremacist who hoped to "ethnically cleanse" Muslims has been told he will serve at least 40 years imprisonment for a terror campaign in which he hunted down a Muslim to murder before he bombed three Midlands mosques aiming to kill and maim worshippers.

Pavlo Lapshyn, 25, came to Britain in April from Ukraine after winning a prize to further his studies. Instead he tried to trigger a race war, fuelled by extremist material on his computer – including a video game called "ethnic cleansing" which celebrated racist violence.

Within a day of arriving and starting a work placement in Birmingham, Lapshyn who was a PhD student, was viewing an extremist rightwing Russian website used by those imprisoned for racist crimes, including murder.

A day later he photographed himself with a Buffalo River hunting knife in his bedroom and three days later took it onto the streets, "intent on finding a Muslim to murder", Mr Justice Sweeney said as he sentenced Lapshyn.

His victim was Mohammed Saleem, 82, walking home from a mosque with the aid of a walking stick in Small Heath, Birmingham, just after 10pm.

Lapshyn approached the grandfather of 23 children from behind, and plunged the blade in so deep it reached the front of Saleem's body. Saleem collapsed, with one wound 18 cm deep.

Lapshyn had pleaded guilty on Monday at the Old Bailey to the terrorist campaign of murder and bombings across the West Midlands from April to July.

He confessed after his arrest that he was a violent racist and had parts for three more bomb attacks.

Photos and video recovered after his arrest revealed him experimenting with bombs in the Ukrainian countryside before he came to Britain. He had also researched where he could get materials in Birmingham to make improvised explosive devices.

He placed bombs outside mosques in Walsall and Wolverhampton in June, before packing his final device with nails which was aimed at worshippers entering Friday lunchtime prayers at Tipton mosque.

Three hundred people would have been in the path of the shrapnel that shot across the car park, leaving nails embedded in tree trunks. But the mosque had temporarily moved prayers back one hour.

The prosecution had said Lapshyn's crimes were so severe he should receive a whole life tariff .

But the judge said he was not sure Lapshyn murdered to "further a cause" but acted alone "motivated by your own extreme and appalling prejudices." Counter terrorism police say there is no sign the PhD student acted under the control and direction of anyone else and that he was self-radicalised.

Lapshyn was sentenced to a minimum term of 40 years, with sentences of 12 years for the three mosque bombings to run concurrently. He was sentenced by the same judge overseeing the case of two men accused of murdering Lee Rigby in May in a London street.

With Saleem's family in court, Mr Justice Sweeney told Lapshyn, who listened impasssively: "You clearly hold extreme rightwing white supremacist views, and you were motivated to commit the offences by religious and racial hatred in the hope that you would ignite racial conflict and cause Muslims to leave the area where you were living.

"Such views, hatreds and motivation are abhorrent to all right thinking people, and have no place whatsoever in our multi-faith and multicultural society."

In a victim impact statement Saleem's daughter Shazia said: "The murder has disabled our minds in every emotional way possible. Dad did not die of old age or illness: he died because he was stabbed violently in the back by a gutless coward."

Lapshyn confessed the murder during police interviews: "I have a racial hatred so I have a motivation, a racial motivation and racial hatred."

He believed a series of attacks would cause more damage with the aim that "the Muslims will have to leave our area".

It emerged that West Midlands police had investigated one of Saleem's children over the killing after receiving a false witness statement. He was eliminated from inquiries.

In a statement, the Muslim Council of Britain said of Lapshyn: "There will be some who will view his activities as those of a lone wolf.

"But in a summer that saw an unprecedented rise in attacks on mosques and Islamic institutions, it is important for all of us to challenge anti-Muslim hatred, just as we challenge those who wrongly use Islam to carry out acts of violence."

Assistant Chief Constable Marcus Beale, head of the West Midlands police counter-terrorism unit, said Lapshyn had shown no remorse or regret.