With the support of Lajos Kossuth and Imre Cseszneky, he was elected to represent Jankovác at the diet of 1848, and in 1849 was made one of the judges of the high court. The national catastrophe (the fall of the revolution of 1848-49) profoundly affected him. For a short time he was an exile, and when he returned to Hungary in 1850 he was already in serious decline. In 1854, he wrote his last poem, "A vén cigány" ("The Old Gypsy"). He moved back to Pest to be close to doctors, and died there, in the same house where Károly Kisfaludy had died 25 years earlier. He was buried in Kerepesi Cemetery. His funeral, on 21 November, was a day of national mourning. His penniless children were provided for by a national subscription collected by Ferenc Deák, who acted as their guardian.