Haines bombarded Aden from his warship in January 1839. The ruler of Lahej, who was in Aden at the time, ordered his guards to defend the port, but they failed in the face of overwhelming military and naval power. The British managed to occupy Aden and agreed to compensate the sultan with an annual payment of 6,000 riyals. The British evicted the Sultan of Lahej from Aden and forced him to accept their "protection." In November 1839, 5,000 tribesmen tried to retake the town but were repulsed and 200 were killed. The British realised that Aden's prosperity depended on their relations with the neighbouring tribes, which required that they rest on a firm and satisfactory basis.