By Laura Pettigrew
BBC News, Lanark
Rally fans and local people began gathering in Lanark High Street more than three hours before the service was due to get under way.
Thousands gathered to pay tribute to the rally star
People had travelled from as far away as Sweden, Spain, the USA and Canada to pay their last respects to a true motorsport legend.
Hundreds of rally cars were parked up on the streets leading into the town and fans sported Subaru hats, jackets and shirts - a sea of bright blue and yellow.
One fan said he had left his home in North Wales at 0400 BST in order to get there.
David Williams, 44, waited patiently on the main street with his wife and son.
He said: "I've been to San Remo and Monte Carlo to watch Colin so we just had to be here today."
Don Lucy, 55, from Northern Ireland said: 'I was in Australia when I heard about the crash and cut short my business trip to come back for the service.
'It is a tragedy. Such an awful thing to happen to such a nice guy."
Mark Finlay, 37, from Falkirk, said he came to pay respects to a legend.
He said: "I've watched him through the years. He was a remarkable man with a remarkable talent.
"As Colin always said 'full throttle, nothing less'."
Shortly after 1500 BST, family, friends, colleagues and classmates of Colin and Johnny McRae made their way inside the church for the service.
Police estimated that around 15,000 fans gathered on the hill leading down to the church.
They fell silent as a lone piper played Flower of Scotland.
There was then a burst of spontaneous applause when he finished.
The rally star's wife Alison and nine-year-old daughter Hollie arrived at the church in a dark car.
Alison McRae smiled sadly at the gathered crowds as she made her way inside.
She was accompanied by Colin's parents, Jimmy and Margaret.
The service was led by the Reverend Alison Meikle.
Outside fans wiped away tears as she said Colin's motto had been, 'We're here for a good time, not for a long time.'
She said the silence had struck the town of Lanark two weeks ago: "a terrible silence bought at a monstrous price".
Campbell Roy, the rally driver's friend and manager read a poignant poem, written by a fan and posted on the McRae memorial website.
It raised sad laughter and raucous applause from the crowds outside.
There was also a tribute from David Richards, the rally driver's mentor and boss.
He said Colin had a passion for racing from a very young age and he recounted a story about a time when he had strapped his hamster to a Scalextric car in order to make the game more exciting.
He said: 'I never met a more competitive man in all my life. Colin had to be first across the finish line every time, and usually always was."
There were tributes from Johnny McRae's headteacher and class teacher.
They described him as a comical and mischievous boy, with a love of cars, eager to follow in his father's footsteps.
Head teacher Jeanette Neilson said he was a charmer.
She added: "All he had to do was smile and ask nicely and he would usually get what he wanted."
Colin McRae's father Jimmy attended the service
His class teacher Miss Hall's voice shook with emotion as she told the congregation.
"Johnny truly was a little ray of sunshine that brightened up our day," she said.
On the large screens outside the church the words to the hymns and songs were broadcast, the crowds encouraged to sing along.
Fans swayed in time to Johnny's favourite track, Islands in the Stream, by Kenny Rogers and Dolly Parton.
The Reverend Alison Meikle acknowledged it was perhaps a strange choice for a five-year-old.
From the tributes inside - including one from Colin's long-time hero, former Rally World Champion, Ari Vatanen - and the fans outside a similar picture of the racing legend emerged.
'Life and soul'
Colin McRae was a man who "pushed the boundaries".
He had a passion, not just for his sport, but for all aspects of life, especially his family.
One fan said he'd been lucky enough to meet the star on the night he won the World Championship in 1995.
He told how he had shared a drink with Colin in a nightclub afterwards.
He said: "He was a star. The life and soul of the party."
As well as personal tributes there was a special film featuring footage of the racing star's career and family photographs and home videos.
Fans from all over the world paid their respects to Colin McRae
The Snow Patrol song, Chasing Cars, provided a soundtrack as fans craned to watch shots of Colin in his early racing days and footage of Johnny on a family ski trip on the large screen outside the church.
More than 60,000 messages have been posted on the Colin McRae memorial website since his untimely death a fortnight ago.
The minister urged Colin McRae's family, friends and fans to take strength from one particular posting.
It read simply: 'Heroes don't die, they just move on to the next stage.'