ATHENS — The Greek government was scrambling on Thursday to resolve an escalating crisis on the Aegean Islands, after violent clashes with residents forced it to withdraw most of the riot police officers it had sent to guard the sites of planned migrant camps.

Hundreds of officers were dispatched this week to the islands, where camps already hold thousands of migrants, in response to increasingly angry protests over the construction plans.

But their presence only heightened tensions. Dozens of officers and 10 residents were injured on Wednesday in clashes on Lesbos and Chios, with two officers sustaining shotgun wounds. Much of the force boarded ferries back to the mainland on Thursday.

Prime Minister Kyriakos Mitsotakis was to meet with the islands’ mayors later Thursday in an attempt to thrash out some kind of compromise, but his government remained adamant that it would proceed with its plans.