Bride Katie Hardy had no idea the Back For Good singer was about to walk in on her big day after friends kept the secret for eight long months.
Even groom Stephen Hardy was kept in the dark, having booked a local Robbie Williams tribute act to fill in at the reception at the Three Nuns pub in Loughborough, Leicestershire, on Saturday.
But when the tribute singer finished his last number, Barlow walked on to the dance floor, belting out Take That’s 2006 hit Rule The World, to the complete shock of the wedding party.
Mrs Hardy said: "The real Gary Barlow walked in, and I just couldn’t believe it.
"It was just the icing on the cake - I was speechless."
The 33-year-old has been a Take That fan since she was eight, seeing the group and Williams perform many times.
She even has the names of the original band members tattooed on her arm.
But unknown to care worker Mrs Hardy, friends and other die-hard fans put the couple’s names forward after Barlow launched a Twitter competition in January, vowing to sing at his most dedicated followers’ wedding.
The group got more than nine million tweets to the star, and Barlow’s management were in touch just days later.
Friends of Mrs Hardy managed to then keep their secret for the next few months - as did Barlow.
Mr Hardy, speaking as he packed for the couple’s honeymoon to Gran Canaria, said: "I had no idea. That’s why I arranged for Tony Lewis, the Robbie tribute, to make a surprise appearance - and then made a fool of myself by singing a bit of Robbie myself before Tony took over."
The couple, who have three children -Kymberlee, Ben and Jessica - said Barlow arrived without fuss and no security, just his personal assistant and driver.
"Afterwards, he stayed on for the wedding photos," said Mrs Hardy.
"I can’t believe it’s me in them."
Mrs Hardy’s childhood friend and fellow fan, Gemma Lawal, said she had to tell Barlow’s people to drive the star around the block after he arrived at the reception venue a few minutes earlier than planned.
She said friends also engineered the singer getting a hand-delivered invitation to the wedding when he was at the red carpet London premiere of the film Kingsman.
"One of the girls had won a competition to be there, so they were able to give him the invitation personally," said Ms Lawal.
She added: "It was brilliant. When Gary came out, her face was a picture."