Mukhtar was born in Ta'if in 622 CE (the year that the Islamic prophet Muhammad migrated to Medina) to Abu Ubayd al-Thaqafi, a Muslim army commander from the Banu Thaqif tribe, and Dawma bint Amr ibn Wahb ibn Muattib. Following Muhammad's death in 632, Abu Bakr became caliph. He died two years later and was succeeded by Umar, who expanded the Muslim conquests initiated by Abu Bakr, and sent Mukhtar's father Abu Ubayd to the Iraqi front. Abu Ubayd was killed at the Battle of the Bridge in November 634. Mukhtar, then thirteen years old, remained in Iraq after the Muslim conquest of this region, and was raised by his uncle Saad ibn Masud al-Thaqafi. Umar was assassinated by a Persian slave Piruz Nahavandi in 644, after which his successor, Uthman, ruled for twelve years before being assassinated by rebels in 656.
After Uthman's death, Ali, a cousin and son-in-law of Muhammad, became caliph and moved the capital from Medina to Kufa, where Mukhtar held some minor office under him, and Mukhtar's uncle became governor of nearby al-Mada'in. A few companions of Muhammad, including Muawiyah, the governor of Syria, refused to recongnise Ali's authority, and war broke out. The Battle of Siffin ended in stalemate (July 657), when Ali's forces refused to fight in response to Muawiyah's calls for arbitration. Ali reluctantly agreed to talks but a faction of his forces, later called Kharijites, broke away in protest, condemning Ali's acceptance of arbitration as blasphemous. Arbitration could not settle the dispute between Muawiyah and Ali and the latter was subsequently murdered by a Kharijite in January 661.
Ali's eldest son Hasan became caliph, but Muawiyah challenged his authority and invaded Iraq. While Hasan was mobilizing his troops, he was injured by a Kharijite near al-Mada'in and was brought to the home of Mukhtar's uncle. There, Mukhtar reportedly recommended that Hasan be handed over to Muawiyah in return for political favour, but was rebuffed by his uncle. In August 661, Hasan abdicated the caliphate to Muawiyah in a peace treaty and the capital was transferred to Damascus. A few years before his death, Muawiyah nominated his son Yazid as his successor, thus founding the Umayyad Caliphate. Yazid's nomination angered Alid partisans,[b] because it was seen as the violation of the peace treaty, which stipulated that Muawiyah would not nominate a successor. Scant information exists about Mukhtar's early life and he only rose to prominence when he was aged around sixty.