Two attackers, a policeman and a court worker have been killed in a car bomb and gun assault on a courthouse in the Turkish city of Izmir, state media say.
Officials blamed Kurdish militants for the attack. A third attacker is reportedly still being sought.
The attackers drove a car to the courthouse entrance, sparking an exchange with police and then detonating the car bomb.
A number of people were wounded in the explosion, some critically.
Some of Turkey’s big cities have been targeted recently both by so-called Islamic State (IS) and by Kurdish militants.
Turkey launched a military operation in Syria in August to push back IS and Kurdish forces from the Turkish border.
IS had said it was behind last weekend’s Istanbul nightclub attack that left 39 people dead.
Deep sense of unease – Analysis by BBC’s Mark Lowen, Istanbul
The only solace today is that the police appear to have thwarted the plan for an even larger attack, based on the number of weapons found. But it’s scant comfort for a country that’s already seen two major terror attacks in the first week of 2017.
It’s left Turks feeling profoundly shaken. One friend told me she wouldn’t take the metro in Istanbul anymore; another that he feared going to public gatherings. The question is how can the authorities secure a country of 80 million people bordering Syria and Iraq and which faces the twin threats of so-called Islamic State and the PKK Kurdish militants?
It can’t be done through increased police alone. Better intelligence is ultimately the answer – and foreign services such as the CIA and MI6 have operatives here helping the Turks. Some attacks are being prevented. But whenever more happen, it deepens the sense that many Turks now have of not feeling safe in their own country.
Izmir’s Governor Erol Ayyildiz the attackers were armed with Kalashnikov rifles and grenades.
Deputy Prime Minister Veysi Kaynak added that, judging by the weapons found following the raid, a much larger attack was being planned.
Images from the scene showed two cars ablaze. The governor said that the second had been destroyed in a controlled explosion.
Reports of the number of people injured in the car bomb blast ranged from five to 11.
President Recep Tayyip Erdogan, speaking at the opening of a metro line in the capital, Ankara, said that Turkey was “under mutual attack by terrorist groups and they want Turkey to be brought to its knees”.
He said: “They won’t be able to set people against each other. They couldn’t destroy our unity.”
No-one has yet said they carried out the Izmir attack but the governor said initial findings pointed to the involvement of Kurdish fighters from the outlawed Kurdistan Workers’ Party (PKK).
Dozens of protesters went to the scene of the attack, shouting anti-PKK slogans.
The PKK is fighting for an independent Kurdish state within Turkey.
It has carried out many attacks on the Turkish security forces, particularly in the south-east.
In claiming the Istanbul nightclub attack, IS blamed Turkey’s military involvement in the Syrian civil war.
At least 36 people are now in custody in connection with the attack, including many in Izmir, although the main suspect remains at large.
A number of those arrested in Izmir are from the Uighur ethnic group. They are believed to have come from China’s Xinjiang region and have ties to the nightclub attacker, the state-run Anadolu news agency says.
Mr Kaynak said they were closing in on the gunman, saying he was possibly an ethnic Uighur.