sentences:  In 873 the Saffarid Ya'qub marched on Muhammad's capital, Nishapur.Muhammad refused to flee and was captured by the Saffarids.For three years he remained in captivity, but was freed by caliphal forces after the Saffarids were defeated at the Battle of Dair al-'Aqul in 876.