Northwestern Pakistan was struck by two separate militant attacks hours apart on Friday, when gunmen wearing suicide vests stormed a Christian colony near the town of Peshawar, killing one civilian, and a suicide bomb attack on a district court in the town of Mardan killed 12 people and wounded 54 others.

Militants stormed the Christian neighborhood early on Friday morning, triggering a shoot-out in which four attackers were killed and one Christian died, police and the military said. Three security officials and two civilian guards were wounded in the attack.

Army spokesman Lt. Gen. Asim Saleem Bajwa said in a statement that the attack was quickly repulsed and that security forces were searching for any accomplices.

Local police official Shaukat Khan said four suicide bombers entered the Christian colony. One of them went into a church, but no one was there at the time. He said the attackers killed one Christian in the neighborhood. It was not immediately clear if any of the suicide bombers had detonated their explosives.

The quick response from the local civilian guards and security forces prevented more deaths, Khan said.

Ahsanullah Ahsan, a spokesman for Jamaat-ul-Ahrar, a breakaway Taliban faction, claimed responsibility for the attack.

In the town of Mardan, some 25 miles from Peshawar, a suicide bomber threw a grenade at the district court before detonating his explosives, according to government spokesman Mushtaq Ghani.

A rescue official, Bilal Jalal, said at least 12 people were killed and another 54 wounded in the suicide attack at the court, among them lawyers, policemen and passers-by. He said some of the wounded in a critical condition.

A local police official, Ijaz Ahmed Khan, said the attacker apparently wanted to target a gathering of lawyers at the bar room but was thwarted by police. When a policeman asked the attacker to stop, the attacker threw a grenade at him, killing the officer, Khan said. A second policeman then opened fire at the attacker, who detonated his explosives.

Lawyer Adil Hussain confirmed the police account.

No group immediately claimed responsibility for court attack.

Pakistan has been struck by a number of large-scale militant attacks in recent months, including a March suicide bombing targeting Christians celebrating Easter in a park in the city of Lahore that killed around 70 people. Jamaat-ul-Ahrar claimed responsibility for the bombing and warned of further attacks.

Christians are a tiny minority in this majority Muslim nation. While some Christians live in Muslim areas, many choose to live together in Christian-only neighborhoods.

Last month, a bomb blast targeting lawyers and journalists gathering outside a hospital in the city of Quetta killed some 70 people. Jamaat-ul-Ahrar and the Islamic State group issued competing claims of responsibility for the attack.

The Pakistani army said on Thursday it had prevented IS from establishing a network in the country, saying it had arrested over 300 IS militants in recent years, including fighters from Syria, Iraq and Afghanistan. The military also claimed it had cleared the Khyber tribal region, which is located near the Christian colony, where Friday's attack took place.

On Friday, Pakistani Prime Minister Nawaz Sharif issued statements condemning both attacks, saying "these cowardly attacks cannot shatter our unflinching resolve in our war against terrorism."

