qnli question: Who was the last Safavid ruler who was defeated in 1722 by the Pashtuns in Isfahan? sentence: The Safavid Era saw the start of mass integration from Caucasian populations into new layers of the society of Iran, as well as mass resettlement of them within the heartlands of Iran, playing a pivotal role in the history of Iran for centuries onwards.