A man who was bullied at school has run 401 marathons in 401 days to raise awareness of the damage caused by bullying.

Ben Smith, 34, finished his last marathon in his home city of Bristol on Wednesday afternoon. Hundreds of runners joined him as he set off from the city’s Millennium Square at 10am, and he was accompanied by children from Portishead primary school for the last mile of the race, which he finished at about 4pm.

Smith has covered just over 10,506 miles since 1 September 2015 – the equivalent of running from London to Sydney. He has raised more than £250,000, which will be donated to Stonewall and Kidscape.

The emotional runner was cheered across the finish line by hundreds of supporters. Afterwards he thanked his parents, partner and team for their support.

“I think I’m in a bit of shock,” he said. “I can’t believe we have done this. Without every single person who has taken part we wouldn’t be where we are now and I can’t thank you enough. I am sure the charities will thank you.”

Smith celebrates with his partner, Kyle, after completing his marathon challenge. Photograph: Rex/Shutterstock

Before he set off, Smith said he was nervous but excited as he gave a motivational speech to his fellow runners – many wearing clothing bearing Smith’s 401 Challenge logo.

“I’ve been trying to raise £250,000 for two anti-bullying charities – Stonewall and Kidscape,” he said. “I was badly bullied for eight years of my life and it affected my self-esteem and confidence, so much so that the only way I felt I could get out of that was to try to take my own life when I was 18. The money we’re trying to raise is going to support these charities to make sure that what happened to me doesn’t happen to anyone else.”

Smith, who decided to complete the challenge after coming out as gay, added that the support he has received has been overwhelming. “I’ve had the privilege of running with more than 9,500 people all round the UK,” he said. “It has been amazing – from areas where I’ve had two or three people out, to where we’ve had 287 out. It has been the journey of a lifetime.”

LIVE on #Periscope: Ben crossing finish line of final marathon of the 401 Challenge #401runwithben https://t.co/1mQBHfiq4D — Patrick Keating (48) (@keatingpatrick) October 5, 2016

Children as young as five and even a jack russell dog have accompanied Smith on parts of his challenge. He ran marathons in locations including the Isle of Wight, Bristol to Bath, Brighton, Greater Manchester, Milton Keynes, Edinburgh and London.

Throughout, Smith has battled injuries including a longstanding spinal problem and pain in his kneecaps, heels and shins. This meant he had to take a 10-day break – but he ran extra miles each day after the break to get back to his 401-day schedule.

The runner has also given 101 motivational talks to schools, colleges and universities to raise awareness of bullying. He has gone through 22 pairs of trainers and burned more than 2.5m calories.

Smith twice tried to take his own life and suffered a ministroke at the age of 29 after years of bullying and physical abuse at school. A friend encouraged him to join a running club during his recovery and he found it helped him regain mental and physical health.

“My story really started when I was 29 and I suffered a TIA [ministroke],” he said. “I was about 16.5 stone [105kg], overweight, unhealthy, smoked, drank – I couldn’t even run for a bus. If somebody had told me four years ago that I’d be doing this, I probably would have sunk my pint, lit my cigarette up and laughed at them. My life has changed dramatically after finding running, both physically and from a confidence point of view as well.”

Smith’s mother, Beverley Smith, said: “It has always been a pleasure to be Ben’s mum but it is just awesome today. I don’t think anyone has written the words to describe how we feel so we decided that a new feeling has come on the market called 401. We feel 401.”

When Smith explained his challenge to his parents, his mother told him: “Go on boy, get it done.”

“I looked him in the eye and said, ‘Do you think you can do it?’” she said. “He said ‘Yes’, and I knew he would.”

Smith also praised his father, Peter, a retired RAF air battle manager, and his partner, Kyle Waters, for helping him achieve his 401 marathons.

Of Waters, he said: “He gave up his PhD and his job to help with this project. I just want to say that I love you from the bottom of my heart. Having met Kyle I am the happiest I have been in my entire life.”