Libya's intelligence chief has resigned amid an intensifying power struggle between the Islamist-dominated parliament and a rival interim government.
Spy chief Salem al-Hassi on Thursday submitted his resignation to parliament, Mohammed al-Arisha, an MP, told the Associated Press news agency without elaborating.
Al-Wasat news portal said al-Hassi resigned because he was frustrated with parliament's insistence on appointing a new prime minister, a move that has intensified the political crisis.
The resignation came as Libya's Supreme Constitutional Court convened to decide on the legality of the election of Islamist-backed Prime Minister Ahmed Maiteg. The court said it would issue its ruling on July 9.
Maiteg was elected last month by the Islamist-led parliament in a contested vote, which prompted incumbent Prime Minister Abdullah al-Thinni to refuse to hand over the post until the judiciary decides on the matter.
Maiteg's appointment adds to Libya's political and security woes at a time when renegade General Khalifa Hifter is waging an offensive against fighters who he calls "extremists".
The general has also warned he would detain Islamist lawmakers, accusing them of financing the militias, which he blames for much of Libya's problems.
Hifter, who has managed to build support among army units, tribes, and a large section of Libyans fed up with violence and lawlessness, survived an assassination attempt on Wednesday.
Libya has sunk into chaos since the ousting and killing of longtime ruler Mouammar Gaddafi in 2011.
With no strong army or police force, militias quickly filled the security vacuum and successive governments relied on them to restore order. They then mushroomed in number and power, posing a challenge to any democratic transition.
In recent weeks, forces allied with Hifter bombed his opponents' camps, and they responded by attacking his forces.
On Thursday, a security official said at least 10 Grad rockets were fired into a district of the city of Benghazi, setting fire to several warehouses there.
Rockets were also fired at the outskirts of Darnah in eastern Libya, a stronghold of the Ansar al-Shariah armed group, which is one of the organisations Hifter opposes.
The official, who spoke on condition of anonymity because he was not authorised to speak to the media, said there were no reports of casualties.