A convicted murderer who escaped from prison 18 months ago has been arrested.

Shaun Walmsley, 29, was sprung from custody when armed men confronted prison guards during a hospital visit in Liverpool in February 2017.

He became one of the UK’s most wanted men as detectives launched an international manhunt, believing he had fled overseas.

Merseyside police said Walmsley was arrested after armed officers stopped a car in the Harehills area of Leeds on Tuesday afternoon.

Witnesses described how police marksmen in balaclavas pounced on the fugitive as he pulled up in a car. One resident said officers smashed the back window of Walmsley’s car before discharging at least three stun guns at the occupants.

“We heard a lot of shouting and it sounded like someone was in a lot of pain,” one said. “There was a lot of screaming, it was chaos.”

Walmsley appeared in court on Wednesday sporting shoulder-length brown hair and a full beard after adopting a new look while on the run.

He confirmed his name and date of birth and that he understood the charge of escape from lawful custody during the short hearing at Liverpool and Knowsley magistrates court.

He appeared in court via videolink and was remanded in custody by magistrates. He will next appear at Liverpool crown court on 19 September.

Walmsley was serving a life sentence with a minimum term of 30 years when he launched an audacious plot to escape from HMP Liverpool.

The convicted drug dealer, who ran a nationwide crime network, was one of four men serving life sentences for the savage murder of Anthony Duffy, 33, who was lured to a street near Aintree racecourse and repeatedly stabbed in May 2014.

Detectives believe Walmsley orchestrated his plan to escape when an appeal against the severity of his sentence was rejected in late 2016. Faced with the prospect of being in jail until his late 50s, they believe he Walmsley fooled prison medics into believing he had a serious illness – losing up to four stone in weight – so he could be referred to specialists at Aintree university hospital.

Walmsley was getting into a minicab with three prison guards when two masked men armed with a machine gun and a machete jumped out of a gold-coloured Volvo. The two men threatened the guards, who released Walmsley from his handcuffs, allowing him to flee in the car.

The convicted killer then fled to Manchester, where it is believed he obtained new identity documents and a mobile phone.

It is not known how police found Walmsley in Leeds, but officers have launched numerous public appeals for information, offering £20,000 of the killer’s money as a reward for any tipoff that led to him being recaptured.

Officers even appealed for football fans to keep an eye out for Walmsley during the World Cup this summer as they suspected he might break cover to watch an England game.