In October the next year , however , the Law and Justice party lost the parliamentary elections , and Jaroslaw was succeeded as prime minister by Donald Tusk , Lech Kaczynski 's defeated rival for the presidency two years before .