The 17-year-old was voted off the show two weeks ago.
But a crowd of a few hundred, waiting for the lights switch on and spectacular fireworks display, grew to an estimated 5,000-plus in just 40-minutes when she tweeted 'Who's in Barnsley' after earlier teasing with 'Switching the Christmas lights on in... See you there.'
Afterwards @SamLavery_ she said: 'Thank you so much Barnsley for having me perform and switch on your Christmas Lights!! You guys were mintttttt,' and added a video message with the words 'Homeeeee...Barnsley you slayedddd'.
The Durham born 17 year old's late announcement was due to safety concerns.
She will be back in the area when all top eight acts from this year's show - 5 After Midnight, Emily Middlemas, Four of Diamonds, Matt Terry, Ryan Lawrie, Saara Aalto, Honey G and Sam Lavery - perform in The X Factor Live Tour at the Sheffield Arena on Friday, March 3, 2017. Full details at www.sheffieldarena.co.uk
Barnsley Council confirmed around 5,000 people attended this year’s lights switch on, which has become the town’s flagship family event.
Joe Sentence, breakfast presenter on Dearne FM, hosted a line-up of entertainment which also included local singer Megan Blackburn, Kyle Tomlinson, who wowed with his version of Nessun Dorma and a performance by the cast of the town’s local pantomime. Children’s character, PAW Patrol, also got a huge cheer.
Mayor of Barnsley Coun Lynda Burgess said: “Thank you to everyone who came along and made it such an amazing night. It was an honour to switch on the lights.”
Seven year old Keira Clarke, who won a Paw Patrol colouring competition organised by this year's event sponsor XPO Logistics, joined the whole cast of the show on stage to press the button to switch on the Christmas lights.
For more Christmas events in Barnsley visit www.barnsley-museums.com