Bride Katie Hardy's friends took part in a Twitter competition to book the singer and won.
As a result, Barlow agreed to join the festivities and hit the stage at the Three Nuns pub in Loughborough, England after a Robbie Williams tribute act.
The newlyweds had no idea about the surprise and were speechless when Barlow showed up and sang 2006 hit Rule the World.
Hardy, who has been a Take That fan since she was eight and is now 33, says, "The real Gary Barlow just walked in and I couldn't believe it. It was just the icing on the cake. I was speechless... Afterwards, he stayed on for the wedding photos. I can't believe it's me in them."
Barlow launched a Twitter competition in January (15), offering to perform at his top fans' weddings. He received more than nine million requests.
Hardy adds, "He follows me on Twitter, so he's obviously read the last few tweets I've posted. I've had a slipped disc, so I've been in bed and so he asked me about that. He was very thoughtful and caring, and said, 'How's your back?' and, 'Are you OK?'"