In 1842, Sultan Omar Ali Saifuddien II ceded complete sovereignty of Sarawak to Brooke. He was granted the title of Rajah of Sarawak on 24 September 1841, although the official declaration was not made until 18 August 1842.
During his reign, Sir James Brooke began to establish and cement his rule over Sarawak: reforming the administration, codifying laws and fighting piracy, which proved to be an ongoing issue throughout his rule. Brooke returned temporarily to England in 1847, where he was given the Freedom of the City of London, appointed British consul-general in Borneo and was created a Knight Commander of the Order of the Bath (KCB).
Brooke became the centre of controversy in 1851 when accusations against him of excessive use of force against natives, under the guise of anti-piracy operations, ultimately led to the appointment of a Commission of Inquiry in Singapore in 1854. After investigation, the Commission dismissed the charges but the accusations continued to haunt him.
Brooke met the naturalist Alfred Russel Wallace in England around 1852 or 1853, because he wrote to Wallace on leaving England in April 1853, "to assure Wallace that he would be very glad to see him at Sarawak". This was an invitation that helped Wallace decide on the Malay Archipelago for his next expedition, an expedition that lasted for eight years and established him as one of the foremost Victorian intellectuals and naturalists of the time. When Wallace arrived in Singapore in September 1854, he found Rajah Brooke "reluctantly preparing to give evidence to the special commission set up to investigate his controversial anti-piracy activities".
During his rule, Brooke faced threats from Sarawak warriors like Sharif Masahor and Rentap, and an uprising by Chinese miners in 1857, but remained in power.
Brooke ruled Sarawak until his death in 1868, following three strokes over ten years.