"I was given a surprise birthday party and I sure was surprised. Even dad and family were in on it. Wow! It's actually my first surprise birthday party," Shahid posted on micro-blogging site Twitter.
The actor was wished by a number of celebrities, including Karan Johar and Farah Ali Khan.
He has thanked everyone for their wishes.
"Thank you all from the bottom of my heart for all the birthday wishes. Love you all," he added.
Shahid also got another surprise when Police raided his party for violating the stipulated deadline. After receiving information that Esco bar, where the actor's birthday bash was on, was entertaining the guests beyond 1.30 am deadline, police reached the place and stopped the music.
After inspecting the pub, manager Subhash Bhosale was fined Rs 5,000 for violating norms of the Bombay Police Act by keeping the bar open beyond 1.30 am deadline, said senior inspector Prakash George of Bandra Police Station.
Shahid's friend and co-star of his last release "Chance Pe Dance", Genelia D'Souza, too attended the party.