Three young men arrive at a train station one night and strike an instant friendship. They are all going to join a prestigious Indian private school, Gurukul.
Gurukul is run by a stern headmaster named Narayan Shankar (Amitabh Bachchan). He is a strict disciplinarian who believes his institute runs because of his principles and rules. Apparently the students are picked from universities all over the country to study at Gurukul and the headmaster has high expectations of them. Moreover, Narayan Shankar has instituted a strict anti-romance policy ? any student who becomes romantically involved will be expelled.
The three friends all have their hearts set on different girls. Sameer (Jugal Hansraj) works in a cafe and is in love with his childhood friend Sanjana (Kim Sharma). Unfortunately for Sameer, she already has a boyfriend. Vikram (Uday Chopra) catches Ishika (Shamita Shetty) stealing apples from the Gurukul gardens, and falls in love at first sight. Karan (Jimmy Shergill) becomes attracted to Kiran (Preeti Jhangiani) when he sees her waiting for a train. Kiran is married to an Army officer who never returned from war, and she behaves as if her husband were still alive because of her father-in-law, General Khanna (Amrish Puri), who holds out hope that his son is alive. However, Sameer, Vikram, and Karan all elect not to take their respective romances to the next level, for fear of Narayan Shankar and his stern ways.
The pupils soon meet Raj Aryan Malhotra (Shahrukh Khan). With flowers and a violin in his hand, Raj wants to join Gurukul as a music teacher. After some reluctance, Narayan Shankar allows Raj to join the institute. Raj spreads the message of love amongst the three young men and encourages them to follow their hearts. He tells them that he loved a woman named Megha (Aishwariya Rai), who is now no longer alive. Nevertheless, Raj continues to love her. The audience gets a glimpse of Megha, who now lives only in Raj's imagination and speaks to him when he is alone.
As the boys fall in love, the relationship between the headmaster and the music teacher begins to become strained. Much to the chagrin of the headmaster, Raj begins to implement many changes. He begins hosting parties (inviting girls from the nearby girls' hostel), celebrating festivals, and encouraging students to break Gurukul's strict rules.
It is revealed that Raj was once also a student of Gurukul, and the girl he fell in love with, Megha, was none other than Narayan Shankar's daughter. When Narayan discovered their romance, he forbade them from seeing each other, expelled Raj from the institution without ever meeting him, and distanced himself from his daughter. Megha became distraught, as she could not forget Raj, and ultimately committed suicide by throwing herself out of her bedroom window. Raj expected this tragic incident to finally transform Narayan, but he instead became more stern and strict. So, Raj made it his mission to spread love throughout Gurukul, and to one day reach out to Narayan Shankar and show him the magic of love and affection.
When Narayan Shankar comes to know that Raj is the same boy, R.A. Malhotra, who was in love with his daughter, he takes all the necessary steps to remove him from the institution. Raj continues to help the three boys and their lovers meet against school rules and the story turns into a war between Raj and Narayan Shankar.
Eventually, Narayan Shankar come to realize that love and change are indeed important parts of life and softens. He steps down and appoints Raj as the headmaster and, in this way, Gurukul is transformed forever into a singing, dancing, and loving school.