By Nevzat Devranoglu and Tuvan Gumrukcu
ANKARA (Reuters) - Suspected Kurdish militants clashed with police and detonated a car bomb in western Turkey on Thursday after their vehicle was stopped at a checkpoint, killing a police officer and a court employee, officials said.
The explosion and gunfire outside the main courthouse in Izmir, Turkey's third largest city, highlighted the country's deteriorating security after a gunman killed 39 people in a New Year's Day mass shooting at an Istanbul nightclub.
"Based on the preparation, the weapons, the bombs and ammunition seized, it is understood that a big atrocity was being planned," Deputy Prime Minister Veysi Kaynak told reporters.
The local governor said the arms included Kalashnikov rifles, hand grenades and ammunition for rocket-propelled grenade launchers.
Izmir police shot dead two of the attackers and were hunting a third, a police source and the state-run Anadolu agency said.
"Our heroic police officer martyred in this attack, Fethi Sekin, prevented a much bigger disaster happening, sacrificing his own life without a thought for it," Prime Minister Binali Yildirim said in a statement, condemning the "heinous" attack.
Two people, believed to have sold the vehicle used in the attack to the assailants, were subsequently detained, security sources said. CCTV footage obtained by Reuters showed a passerby fleeing as the vehicle exploded in a fire ball.
Initial findings suggested that Kurdistan Workers Party (PKK) militants were behind the attack, Izmir governor Erol Ayyildiz said.
Dozens of people rushed to the scene of the blast and chanted "God damn the PKK" and other slogans against the militant group. A helicopter was seen flying overhead.
Ayyildiz said a second vehicle had been detonated in a controlled explosion. Anadolu said police suspected the attackers had planned to escape in this vehicle.
NATO member Turkey is part of the U.S.-led coalition fighting Islamic State in Syria and is also battling an insurgency by the PKK in the largely Kurdish southeast.
It regularly bombs PKK camps in northern Iraq and its military operations in Syria also aim to stop Kurdish militias it sees as an extension of the PKK from gaining territory there.
"Turkey will be instrumental in its region. These (attacks) will never prevent us from being present in areas like Iraq and Syria, which produce terrorists like viruses," Kaynak said.
INCREASINGLY DEADLY ATTACKS
Ayyildiz said the clash outside Izmir's main Bayrakli courthouse erupted after police officers tried to stop a vehicle at a checkpoint and that the attackers detonated the car bomb while trying to escape.
The PKK - deemed a terrorist organization by Turkey, the United States and European Union - and its affiliates have been carrying out increasingly deadly attacks over the past year and a half, ever further from the largely Kurdish southeast, where they have fought an insurgency for more than three decades.
A PKK offshoot claimed responsibility for twin bombings that killed 44 people, most of them police officers, and wounded more than 150 outside an Istanbul soccer stadium on Dec. 10.
A car bomb a week later killed 13 soldiers and wounded 56 when it tore through a bus carrying off-duty military personnel in the central city of Kayseri, in an attack President Tayyip Erdogan also blamed on Kurdish militants.
There was no immediate claim of responsibility for the attack in Izmir, a liberal coastal city which had largely escaped the violence that has plagued Istanbul and the capital Ankara in recent months.
Police detained 20 suspected Islamic State militants thought to be of Central Asian and North African origin in Izmir on Wednesday, in raids Turkish media said were linked to the Istanbul nightclub attack.
(Additional reporting by Ece Toksabay and Orhan Coskun in Ankara, Humeyra Pamuk, Can Sezer, Ceyda Caglayan Birsen Altayli and Daren Butler in Istanbul; Writing by Nick Tattersall; Editing by Ralph Boulton)