Islamabad: A powerful car bomb detonated in a residential area in Pakistan's capital on Friday, killing two suspected militants and an officer, police said, raising fears that militants have a presence in one of the country's safest cities, reported Irish Examiner.

At least three police officers and seven passers-by were wounded in the bombing.

Friday's bombing in Pakistan's capital city took place nine miles from the garrison city of Rawalpindi, home of the military and government spy agencies.

The Pakistani Taliban claimed responsibility for the explosion, reported Irish Examiner.

The Islamabad Police declared a 'red alert' in the city shortly after the blast, the Dawn newspaper reported.

"Security has been re-alert in Islamabad. Carrying weapons is not allowed under any circumstances. Election-related meetings will not take place without the permission of the police. Election activities and corner meetings will be allowed inside the four walls," Islamabad Police tweeted.

Police said the blast took place when police officers spotted the car and ordered the driver to halt for routine checking.

Instead of stopping, its driver detonated explosives hidden inside. A female passenger in the car also was killed, Suhail Zafar Chattha, a senior police officer in Islamabad told reporters at the scene, reported Irish Examiner.

TV footage showed a burning car as police officers cordoned off the area.

Residents said they saw policemen on motorcycles chasing a car and ordering a man inside the vehicle to come out.

Police confirmed that account, saying the suspect blew up the explosive-laden vehicle after being surrounded by police officers.

Pakistani Prime Minister Shehbaz Sharif condemned the bombing and thanked the police.

"Police officers stopped the terrorists by sacrificing their blood and the nation salutes its brave men," Sharif said in a statement.

Mohammad Khalid Khurasani, the spokesman for the Pakistani Taliban or TTP, said in a statement one of the group's militants carried out the suicide attack to avenge the killing of a senior leader, reported Irish Examiner.

Abdul Wali, widely known as Omar Khalid Khurasani, was killed in a roadside bombing in August in Afghanistan's Paktika province. His death was a heavy blow to TTP, who blamed Pakistani intelligence agents for the killing.

Pakistani Taliban have stepped up attacks on security forces since November, when they unilaterally ended a months-long ceasefire with the country's government.

The latest violence comes days after several Pakistani Taliban detainees overpowered their guards at a counterterrorism centre in north-western Pakistan after snatching police weapons and taking three officers hostage.

On Tuesday, Pakistan's special forces raided the detention centre, triggering an intense shootout in which the military later said 25 detainees linked to the Pakistani Taliban were killed in Bannu, a district in the Khyber Pakhtunkhwa province and part of a former tribal region.

Three troops and at least three hostages were killed in that incident.