A bomb attack at a police station in Istanbul has injured five police officers and two civilians, Turkey's state-run Anadolu Agency has reported.

The attack targeted the police station in Istanbul's Sultanbeyli neighbourhood early on Monday morning and caused a fire that collapsed part of the three-storey building, the agency reported.

The explosion also damaged neighbouring buildings and around 20 cars parked nearby, the private Dogan news agency reported.

One of the police officers injured in the explosion is reportedly in critical condition.

Al Jazeera's Bernard Smith, reporting from Istanbul, said the blast struck at about 1am local time on Monday morning.

"The neighbourhood is right on the outside edge of Istanbul in what could be called a 'conservative' area, way away from the central part of the city," he said.

He said that there was no immediate claim for the attack, which comes at a time of a sharp spike in violence between Turkey's security forces and fighters from the Kurdistan Workers' Party, or PKK.

The attacks also come at a time when Turkey is taking a more active role against Islamic State of Iraq and the Levant (ISIL) fighters.

Later in the morning, the police officers investigating the incident at the scene were shot at, local media reported.

One civilian was injured in the attack carried out by unnamed armed people, according to the Dogan news agency.

US consulate attack

In a separate incident, a gun attack targeted the US Consulate in Istanbul leading to an exchange of fire between assailants and security personnel, according to local media reports.

The reports said that one attacker was male and the other one was female, adding that the police was searching for the suspects.

Last month it conducted aerial strikes against ISIL positions in Syria and agreed to let the US-led coalition use its bases for its fight against ISIL.

The move followed a suicide bombing blamed on ISIL which killed 32 people and after ISIL fighters fired at Turkish soldiers from across the border in Syria, killing one soldier.

Police cordoned off the area but people gathered outside the police station shouted slogans against the PKK, Turkey's Hurriyet newspaper reported.