Although Qatar had the legal status of a dependency, there was a popular sentiment of resentment against the Al Khalifa. In 1867, the Al Khalifa, along with the ruler of Abu Dhabi, sent a massive naval force to Al Wakrah in an effort to crush the Qatari rebels. This resulted in the maritime Qatari–Bahraini War of 1867–1868, in which Bahraini and Abu Dhabi forces sacked and looted Doha and Al Wakrah. However, the Bahraini hostilities were in violation of the 1820 Anglo-Bahraini Treaty. The joint incursion, in addition to the Qatari counterattack, prompted British political agent Lewis Pelly to impose a settlement in 1868. His mission to Bahrain and Qatar and the resulting peace treaty were milestones because they implicitly recognised the distinctness of Qatar from Bahrain and explicitly acknowledged the position of Mohammed bin Thani. In addition to censuring Bahrain for its breach of agreement, the British protectorate asked to negotiate with a representative from Qatar, a role which Mohammed bin Thani was selected to fulfil. The results of the negotiations left the nation with a new-found sense of political identity, although it did not gain an official standing as a protectorate until 1916.