The origin of the Royal Navy of Oman can be traced to the reign of Imam Ghassan bin Abdullah (807-824 CE). He was the first ruler of Oman to possess a Navy. He commissioned ships in order to fend off pirates operating along the western shores of the Indian Ocean who were conducting raids along the coast of the Arabian Peninsula.