Regardless of his origins, Ali appears to have spent at least a part of his youth living in the area of Rayy, and at an unspecified date he moved to the Abbasid capital of Samarra, where he mixed with some of the influential slaves of Caliph al-Muntasir (861-62). In 863, he made his way from Samarra to Bahrain (modern eastern Arabia), where he pretended to be Shi'i and started to rouse the people into rebellion against the caliphate. Support for his cause quickly grew. A large number of Bahranis submitted to his authority and the "kharaj" (land taxes) were collected in his name. Despite this, his rebellion eventually failed due to opposition from the local inhabitants, whereupon Ali abandoned the region and relocated to the city of Basra in southern Iraq in 868.