Turkish bombing
Turkish policemen examine the site after a shooting incident near the entrance to Dolmabahce Palace in Istanbul, Turkey, Aug. 19, 2015. REUTERS/MURAD SEZER

Gunmen fired on police outside an Istanbul palace and a bomb killed eight soldiers in the southeast on Wednesday, heightening a sense of crisis as Turkey's leaders struggled to form a new government.

The Istanbul governor's office said two members of a "terrorist group" armed with hand grenades and an automatic rifle were caught after attacking the Dolmabahce palace, popular with tourists and home to the prime minister's Istanbul offices.

One police officer was slightly wounded in the attack, state-run Anadolu news agency reported.

Militants from the Kurdistan Workers Party (PKK) meanwhile killed eight soldiers with a roadside bomb in the southeastern province of Siirt, the military said, intensifying a conflict there after the breakdown of a two-year ceasefire last month.

Shortly before the bomb attack, Turkish F-16 warplanes had hit and destroyed PKK shelters along Turkey's border with Iraq, the Hurriyet newspaper said on its website. The report could not immediately be confirmed.

The unrest in the NATO member state comes weeks after it declared a "war on terror", opening up its air bases to the U.S.-led coalition against Islamic State, launching air strikes on Kurdish militants, and detaining more than 2,500 suspected members of radical Kurdish, far-leftist and Islamist groups.

Security forces have killed 18 PKK militants in clashes across Diyarbakir province in the last two days, Anadolu said.

The latest attacks come a day after Prime Minister Ahmet Davutoglu gave up on efforts to form a new government after weeks of coalition talks with the opposition failed, possibly paving the way for another election within months.

"Because of the failure to form a government, we have to seek a solution with the will of the people ... so we are heading rapidly towards an election again," President Tayyip Erdogan said in a televised speech.

The lira slid to a new low against the dollar as investors took fright at what some have dubbed a "perfect storm" of political uncertainty, slowing growth and deepening violence.

The currency has seen its steepest five-day decline this week since May 2010, making it one of the world's worst-performing emerging markets currencies.

There was no claim of responsibility for the attack at Dolmabahce palace, where the two assailants opened fire on police guarding the entrance.

Police sources said the two had been detained in the past in connection with attacks by the leftist Revolutionary People's Liberation Army-Front (DHKP-C), according to Dogan news agency.

Davutoglu was in the capital Ankara as reports of the shooting emerged and did not interrupt a speech he was giving live on television.

In response to the PKK attack, a nationalist opposition party called for an extraordinary meeting of the National Security Council and the declaration of "martial law" measures in parts of the country in line with constitutional provisions.

"Security must be established with martial law measures in a section of the country, covering provinces and districts where there are scenes of violence and horror," MHP leader Devlet Bahceli said in a written statement.

Turkey has been on heightened state alert since launching what Davutoglu described a "synchronized war on terror" in July, exposing it to reprisals from Islamic State sympathizers, Kurdish militants and leftist radicals alike.

A fighter proclaiming allegiance to Islamic State appeared in a video this week urging Turks to rebel against "infidel" Erdogan and help conquer Istanbul.

The DHKP-C claimed responsibility earlier this month for an attack on the U.S. consulate in Istanbul, in which two women shot at the building. One of the attackers was hurt in an exchange of fire but there were no other casualties.

GOVERNMENT PARALYSIS

The ruling AK Party, which Erdogan founded, in June suffered its biggest election setback since coming to power in 2002, failing to win a single-party majority for the first time and plunging Turkey into uncertainty not seen since the fragile coalition governments of the 1990s.

The failure of Davutoglu's efforts to find a junior coalition partner led him to hand the mandate to form the next government back to Erdogan late on Tuesday. Presidential sources said Erdogan would consult with the speaker of parliament later on Wednesday on how to agree the next cabinet.

He could now give the mandate to the main opposition Republican People's Party (CHP), although he has appeared reluctant to do so, and the CHP would in any case be unlikely to be able to form a working coalition by an Aug. 23 deadline.

Erdogan told academics at a meeting on Wednesday that he favored forming an interim "election cabinet" before new polls in the autumn, according to the Hurriyet Daily News.

Such an arrangement would see power temporarily shared between four political parties with deep ideological divides, potentially paralyzing policy-making and further unraveling investor confidence.

The CHP said on Wednesday it was "unthinkable" that it would take part in such a government.

Parliament could in theory also vote to allow the current cabinet to continue working until a new election, but at least one of the opposition parties, the nationalist MHP, has already said it would vote against such a move.

Erdogan, who won Turkey's first popular presidential election in August 2014 and has since stretched the powers of a largely ceremonial post to their limits, has said the system of power has changed in Turkey.

He has championed a full presidential system akin to the United States or France, a constitutional change that would be virtually impossible without a single-party AKP government, but has also insisted that even without that step, his election by the people has bestowed him with extra authority.

"There is now a president in the country not with symbolic power, but with literal power," he said last week.