ISTANBUL — Attackers opened fire outside the United States Consulate here on Monday morning, setting off a brief gun battle with the police as violence in Turkey continued to escalate nearly two weeks after the government began what it called a major counterterrorism effort, including increased cooperation with the United States in the fight against the Islamic State.

No Americans or Turkish police officers were wounded in the attack, which ended when the two assailants fled. Turkish special forces later caught an injured woman at a house in the Sariyer district of Istanbul suspected of having taken part in the attack, according to the Anadolu news agency.

The assault was one of four major incidents of violence across Turkey on Monday, none of them attributed to the Islamic State. They were instead linked to the Marxist and anti-American Revolutionary People’s Liberation Party-Front, which claimed responsibility for the consulate attack, and the Kurdistan Workers’ Party, or P.K.K. That group has fought an insurgency in Turkey for more than three decades, and the government views it as a primary threat.

The pattern of increased violence in recent weeks has raised alarm among the Turkish public, and comes against the backdrop of political instability. After national elections on June 7, the Islamist Justice and Development Party, or A.K.P., which has governed for more than a decade, was left without a majority in Parliament, and has failed to agree on a coalition with opposition parties since then. With those talks seemingly deadlocked, the prospect of new elections, probably in November, has become more likely.