In November 1873 however, a ship from Penang was attacked by pirates near Kuala Langat, Selangor. After a number of piracy attacks took place in Selangor, Andrew Clarke assigned Frank Swettenham as a live-in advisor to Sultan Abdul Samad in August 1874. Sultan Abdul Samad accepted James Guthrie Davidson, a lawyer from Singapore, as the first British Resident of Selangor in 1875. In October the same year, Sultan Abdul Samad sent a letter to Andrew Clarke requesting for Selangor to be placed under the British protectorate.