Babak was the leader of the Khurramiyyah heresy. He was a Persian and was based in the Babak Castle near Tabriz. Babak led rebellions against the Abbassid caliph. Rebellions that were unsucessful, but that would not completely crush the Khurramiyyah movement.