The 17-year-old singer was mobbed by his classmates as he visited St Aidan's High, in Wishaw, North Lanarkshire, to perform for pupils.
Later in the day the teenager,who is known as Nicky to his friends, took Louis Walsh to meet family members at his home nearby, where he presented his mentor with a bottle of Irn-Bru and a box of Tunnock's Teacakes.
Hundreds of fans turned up at his home to catch a glimpse of the young star - and he did not disappoint.
The singing sensation leaned out of his bedroom window to belt out songs through a loudspeaker as he entertained the crowd.
Nicholas will battle it out this weekend against Luke Friend and Sam Bailey in a bid to take home the X Factor crown. But he was enjoying being the only one in the spotlight yesterday as more than 1000 pupils lined up outside his school.
Nicholas waved to his peers, who chanted: "Go Nicky," and held posters saying: "Number one fan" and "marry me", as he circled St Aidan's in a helicopter in the morning.
When he landed at Cumbernauld Airport he was whisked back to the school, which had organised a piper for his arrival.
Head teacher Tony Rooney said: "The whole school is so excited about having Nicholas back. Music is where he excelled and we've known for a long time, and so does the music department, how talented he is."
One of his teachers, Morag Telfer, said: "He has always had such a great voice and we all are voting like mad for him to win."
One of Nicholas' best friends Nathan Gilchrist, 17, said he was "so supportive" of his friend after everything he had been through.
Nicholas has to take daily medication after he suffered a life-threatening heart attack playing football when he was eight.
Sixth-year pupil Nathan said: "We can't wait to show him how much we're supporting him." The fifth and sixth year pupils gathered in the school hall to hear Nicholas sing the Christina Perri ballad, A Thousand Years, before launching into Just the Way You Are by Bruno Mars.
Nicholas appeared overwhelmed at the amount of support. He said: "I keep seeing people I haven't seen in ages. Last time I was here (on the school stage) I think I was doing the Christmas concert."
His mother Eileen, 45, added: "The support is incredible. I'm so proud of my son. I'm glad to be having him back even if it is just for a wee visit."
Nicholas finished his trip with a gig at Motherwell Civic Centre.