A London marathon impostor who swiped a lost race number to see “a dream come true” has been jailed for 16 weeks.

Stanislaw Skupian crossed the finish line with legitimate runner Jake Halliday’s number after spotting it 300 metres from the end of the 26.2-mile race, Uxbridge magistrates court heard on Thursday.

The homeless 38-year-old was pictured celebrating with a finisher’s medal on 22 April.

Halliday, who was running for the charity Bloodwise, dropped his number after stopping short of the finish line to take off his T-shirt during the hottest London marathon on record.

Friends later told him someone had been pictured celebrating with his number, with Halliday saying he was “shocked”, the court heard.

Defending, Jameela Jamroz said Skupian, a father of one, harboured ambitions of running the race and had started training for it.

She said: “He wanted to be there, he was excited. He wanted to see the runners.

“He says by chance he saw a race identifier on the floor.

“In his excitement he picked up the identifier thinking this was his opportunity to compete in the marathon and that this was in fact a dream come true for him.

“He joined in the marathon and completed the latter part of the race.

“At the time he hadn’t fully quite appreciated that he was doing anything wrong.

“He dedicated the completion of it to his seven-year-old son and to homeless people to inspire them that good things can happen to those that are less fortunate.”

The London marathon chief executive, Nick Bitel, said the episode could be seen to damage the reputation and integrity of the race, regarded as one of the best organised in the world, the court heard.

Skupian has lived in the UK for around 11 years and suffered a neck injury in a serious car crash at the end of last year, forcing him to take sick leave from a catering trade job, Jamroz said.

Around the same time he separated from his wife and became homeless.

Shortly before the race Skupian suffered a short, temporary breakdown in his mental state, she added.

He was arrested after police searched the multi-faith prayer room at Heathrow airport, where he was found with items including a primary school worker’s ID card and a pink diary holding overtime hours worked by airline staff.

Skupian viewed the airport as a temporary home and would pick up left-behind objects to pass to lost property, claiming he was going to return the items, the court heard.

Skupian, who wore a grey jumper and used a Polish translator, pleaded guilty at the earliest opportunity last month to fraud by false representation and to three unrelated counts of theft.

“The offences are so serious as only a prison sentence will suffice,” magistrate Michael O’Gorman said.

Skupian was sentenced to 13 weeks for the fraud and three weeks for the theft offences, to be served consecutively.

He was also given a criminal behaviour order banning him from Heathrow airport for three years unless he had a pre-booked flight ticket for that day.