Mr Erdogan, who has resisted demands from the Turkish armed forces for the past six months for a green light to cross the border into Iraqi Kurdistan, where the guerrillas are based, called an emergency meeting of national security chiefs to ponder their options in the crisis, a session that some said was tantamount to a war council.

A Turkish incursion is fiercely opposed by Washington since it would immensely complicate the US campaign in Iraq and destabilise the only part of Iraq that functions, the Kurdish-controlled north.

Two Turkish soldiers were killed yesterday in booby trap explosions laid by guerrillas of the Kurdistan Workers' party (PKK) - fighters classified as terrorists by Ankara, Washington and the European Union. Those casualties followed the killing of 13 Turkish soldiers in the south-east on Sunday when PKK forces outgunned a Turkish unit of 18 men without sustaining any casualties, according to the Kurds.

Last week, in an ambush also ascribed to the PKK, gunmen sprayed a bus with automatic fire in the same region, killing 13 civilians, including a boy of seven.

The Turkish media described the toll from the attacks as the worst in 12 years in a conflict spanning several decades that has taken almost 40,000 lives.

Mr Erdogan is known to think little of the invasion option, making the pragmatic calculation that it would probably fail. Western diplomats in Ankara agree that an invasion could be counter-productive. The Turkish military raided Iraqi Kurdistan dozens of times in the 1990s but were unable to suppress the insurgency.

After a cabinet meeting dominated by the Kurdish conflict, Cemil Cicek, the Turkish government spokesman, said yesterday: "What is at issue here is how much any action we decide to take would bring us closer to a result." He did not rule out an invasion but queried its "usefulness".

The prime minister, however, is being challenged by the army command, which earlier this year demanded his authority to invade. He is also vulnerable to a mounting public clamour to act because of the upsurge in guerrilla activity and the heavy casualties being suffered. Hardline Turkish nationalists entered parliament in Ankara following elections in July and they are also baying for Kurdish blood.

Following the soldiers' deaths on Sunday, Mr Erdogan signalled a shift in policy without specifying how. "Our campaign against terrorism will continue in a different manner," he said. The Turkish military has just declared 27 "security zones" on the Iraqi and Iranian borders off-limits to civilians, suggesting to some that it might be gearing up for an invasion.

But despite the rising violence, Mr Erdogan has opted for politics in his attempts to defuse the conflict with the Kurds. His Justice and Development party (AKP) enjoyed a stunning success among the Kurdish minority, concentrated in the south-east, in the July elections and he has also focused on political pacts with Baghdad to get the better of the guerrillas.

Last week Iraqi and Turkish interior ministers signed an accord aimed at combating the PKK by trying to cut the rebels' funding and logistics, and agreeing to extradite captured "terrorists". The accord, however, took three days to thrash out; Turkish insistence on a "hot pursuit" formula, allowing cross-border raids, was denied, and scepticism is high as to whether Baghdad can deliver.

Officially, Ankara refuses to recognise or deal with the government of Iraqi Kurdistan, although there have been back-channel attempts over the past year to engage with Massoud Barzani, the president of the Iraqi Kurdish region.

Mr Erdogan's options are also constrained by strong US hostility to an invasion. While Turkish public opinion has been strongly anti-American since the 2003 invasion of Iraq, much of the logistical support for the US troops goes to Iraq via Turkey. Relations are also under severe strain because of US congressional moves to brand the 1915 massacres of Armenians in Ottoman Turkey as "genocide".

Mr Erdogan sent aides to Washington yesterday to lobby Congress on the "genocide" resolution. Ankara is also warning that it could block the logistical support to the US in Iraq if the resolution is passed.

PKK guerrillas

The Kurdish separatist guerrillas of the Kurdistan Workers' party, or PKK, have been at war with the Turkish state since the early 1980s. Although it is now said to favour home rule within Turkey over secession, the PKK has historically pursued the breakaway of Kurdish-dominated south-east Turkey as a prelude to unifying Kurdish lands in Turkey, Iraq, Iran and Syria. Turkey pursued a scorched earth policy in the 1980s and 1990s, destroying thousands of villages, sending millions of Kurds west and leaving some 37,000 dead. Turkey's biggest coup came in 1999 with the capture of the PKK leader Abdullah Ocalan, who was jailed for life.