Iranian dissident filmmaker Jafar Panahi's revenge thriller It Was Just an Accident won the Palme d'Or at the Cannes Film Festival on Saturday, handing the festival's top prize to a director who had been banned from leaving Iran for more than 15 years.