Most of this evocative and eternal love story is revealed as a flashback from the prison cell of Veer Pratap Singh.
The narrative begins by showing Zaara Haayat Khan (Preity Zinta), an independent, carefree, and sprightly young Pakistani girl travelling to India. She is on her way to India with the ashes of her Sikh governess Bebe (a Punjabi word to denote mother or grandmother, but here used for Zaara's old governess). Before dying, Bebe (Zohra Sehgal) begs Zaara to fulfill her final wish - to take her ashes to India, to the holy Sikh city of Kiratpur, and scatter them in the Sutlej river, among her ancestors. Zaara decides to carry out Bebe's dying wish.
Upon reaching India, Zaara's bus meets with an accident causing it to overturn. An Indian Air Force pilot, Squadron Leader Veer Pratap Singh (Shah Rukh Khan) comes to her rescue and with his help, Zaara completes Bebe's final rites. Veer convinces Zaara to return with him to his village to spend one day together. Zaara agrees and Veer takes her on a tour of India's Punjab. They visit Veer's home village on the day of the Lodi festival and meet Veer's uncle Choudhary Sumer Singh (Amitabh Bachchan) and aunt Saraswati Kaur (Hema Malini). With his uncle telling Veer that, in a dream he has seen Zaara becoming Veer's wife, Veer realises he is falling in love with Zaara. Taking her to catch her train to Lahore, Veer is just waiting for the right time to tell Zaara about his feelings, but before he can do that they are met by Zaara's fiance, who has come looking for her, Raza (Manoj Bajpai). Just before she boards the train, Veer confesses his love to Zaara. He gets no sense of Zaara's feelings, but as she is leaving he discovers he still has one of her silver anklets. She nods for him to keep it; both believe that this is the end of the road for their relationship and that they will probably never meet again.
On reaching Pakistan, Zaara realises that she is having deep feelings of love for Veer, but that it is her duty to keep her family's honour and marry her fiancé, a wedding that will further her father's political career. She initially tells her mother of an Indian man who is ready to give his life for her and for whom she has fallen for. Soon Zaara starts to see Veer everywhere and finally tells Shabbo (Divya Dutta), her maid and friend, that she has fallen in love with him. Shabbo calls Veer and tells him how miserable Zaara is without him. She asks him to come and take Zaara away. Veer who had told Zaara that he would give up his life for her, quits the Indian Air Force and goes to Pakistan to bring her back with him to India. Zaara's mother, Mariam Hayaat Khan (Kirron Kher), however, begs him to leave Zaara as Zaara's father, Jahangir Hayaat Khan (Boman Irani) is a high-profile politician whose reputation, and health, will be ruined if news gets out that his daughter is in love with an Indian. Veer respects this request and decides to leave for India but Raza, who is outraged by the shame Zaara has brought upon him, frames Veer and has him wrongly imprisoned on charges of being an Indian spy.
The story moves forward by 22 years and Veer now meets Saamiya Siddiqui (Rani Mukerji), who is an idealistic Pakistani lawyer, whose mission in life is to pave the path for women's empowerment in Pakistan. The Pakistani government has decided to review the cases of some Indians, but stacking the deck against Siddiqui winning her first case, she has been given the case of prisoner 786 (Veer). Many view it as an impossible task as the man has been languishing in prison and has not spoken to anyone for the last 22 years. Also, the prosecution is led by Zakir Ahmed (Anupam Kher), her ex-boss who has never lost a case.
Veer opens up to Saamiya and tells her that she can fight his case but cannot mention, much less subpoena, Zaara's family. The number 786 is considered by some Muslims to be a holy number in Islam; this convinces Saamiya that God has chosen Veer for some special purpose, and she becomes even more determined to exonerate him, restore his name and identity, and return him to his country.
After the prosecution presents it case, Saamiya realises she must cross the border and find someone in Veer's village who can prove Veer's true identity. There, Saamiya meets Zaara, who had fled to India and has taken over running the girl's school after the deaths of Veer's uncle and aunt. She had thought that Veer died on his bus that ran off a cliff, killing everyone on its way to India. Saamiya takes Zaara back to Pakistan to tell the court the truth about Veer's identity. The judge releases Veer from prison and apologises on behalf of Pakistan. After Veer is finally released, he and Zaara say goodbye to Saamiya and Pakistan at the Wagah border crossing, returning to their village together.