Guru Nanak founded the Kartarpur town by Ravi River in 1504, plowing the fields and setting up a community kitchen, or Langar. He assembled a Sikh commune there, and lived for 18 years until his death on 22 September 1539. The gurdwara is built where Guru Nanak is said to have died.