The news of Olafsson's exit comes weeks after the drugmaker cut the annual sales and margin forecasts for its generics unit.
Hikma shares, which have risen about 85% since Olafsson took the helm in February 2018, were down about 2% in early trade on Tuesday.
Before joining Hikma, Olafsson served as the chief executive of the global generics business of Israel-based Teva from 2014 to 2016.
The FTSE 100 firm said it has started the search for Olafsson's replacement and that Executive Chairman and former top boss Said Darwazah will take up the CEO role on an interim basis.
(Reporting by Sinchita Mitra in Bengaluru; Editing by Sherry Jacob-Phillips and Aditya Soni)