An operation to apprehend the attackers who fired a rocket at the police was under way, Istanbul Governor Vasip Sahin said on Twitter.

Rocket attacks targeted the main police station and ruling Justice and Development Party's headquarters in Istanbul on Friday night.

Unidentified assailants first targeted the police headquarters in Istanbul, Turkey's largest city. The rocket missed the building and there were no reports of casualties, broadcaster CNN Turk said.

Istanbul Governor Vasip Sahin said on Twitter that no one was hurt in the police headquarters attack and an operation was under way to catch the attackers. Turkish Prime Minister Binali Yildirim blamed the assault on terror groups.

The police headquarters is located in the Fatih district of Istanbul, on the European side of the city.

Hours later, a second attack hit the Justice and Development Party's provincial headquarters.

The party's provincial head Selim Temurci said on Twitter there were no injuries in the attack on the party's office.

The rocket pierced the wall of the Justice and Development Party's office building but did not explode. (AA)

Later, speaking to reporters, Temurci said the rocket pierced the wall of the building but did not explode. He said two assailants were involved in the attack.

President Recep Tayyip Erdogan was briefed by Temurci and Sahin.

Turkey has been hit by a series of gun and bomb attacks in recent months, some claimed by PKK, a designated terror organisation, others claimed by Daesh, also a designated terror group.

A gunman killed 39 people in an Istanbul nightclub during New Year celebrations in an attack claimed by Daesh.

On December 10, two bomb blasts outside the famous Vodafone Arena, a football stadium, in the city, killed 44 people.