"The first opinion is that the earth was inhabited by the jinn, whom Allah, may He be exalted, created from fire. This opinion was narrated from most of the mufassireen.
At-Tabari narrated in his Tafseer from Ibn ‘Abbas (may Allah be pleased with him) that he said:
The first ones to dwell on earth were the jinn, and they caused mischief therein, shedding blood and killing one another.
It was narrated from ar-Rabee‘ ibn Anas that he said:
Allah created the angels on Wednesday, and He created the jinn on Thursday and He created Adam on Friday. Then some of the jinn disbelieved, and the angels used to come down to earth to fight them, and there was bloodshed and corruption on earth.