Bahrain fell under the control of Ahmed ibn Muhammad ibn Khalifa in 1783, following the defeat of Nasr Al-Madhkur who ruled the archipelago as a dependency of Persia. (See Bani Utbah invasion of Bahrain.) Ahmed ruled Bahrain as hakim until 1796, but was based in Zubarah (in modern day Qatar) and spent summers in Bahrain. Ahmed was the first hakim of Bahrain and the progenitor of the ruling Al Khalifa family of Bahrain. All of the Al Khalifa rulers of Bahrain are his descendants.
Ahmed had four children. Following his death in 1796, two of Ahmed's sons Salman and Abdulla moved to Bahrain, and co-ruled it as feudal estates and imposed taxes on the indigenous Baharnah population. Salman settled in Bahrain Island and Abdulla in Muharraq Island, each ruling independently. The Al Khalifa soon became split into two branches, Al-Abdulla and Al-Salman that engaged in open conflict between 1842 and 1846.[b] Al-Salman branch was victorious and enjoyed complete rule of Bahrain. Until 1869, Bahrain was under threat of occupation by various external powers including the Wahhabis, Omanis, Ottomans, Egyptians and Persians, yet the Al Khalifa managed to keep it under their control. The Al-Abdulla branch continued to be a cause of threat until 1895. Today, Abdulla ibn Ahmad Al Khalifa descendants live in Qatar, while Salman ibn Ahmad Al Khalifa's descendants live in Bahrain.