KHAR, Pakistan — Dozens of militants from Afghanistan who attacked a Pakistani village and took scores of hostages have fled back across the border, leaving the captives behind after a deadly battle with the army, officials said Friday.

The fighters who staged the cross-border attack on Thursday around 2 p.m. local time came from Afghanistan's Kunar province and appeared to be targeting members of an anti-Taliban militia in Kitkot village near Pakistan's Bajur tribal area, in the northwest.

Pakistan has railed against Afghan and NATO forces for not doing enough to stop the rising number of cross-border attacks, which it says have killed dozens of members of its security forces. However, there has been little sympathy from the U.S. and Afghan governments, which have long complained Pakistan allows sanctuary to militants fighting in Afghanistan.

The militants in Thursday's attack fled Kitkot under the cover of darkness late that night, said Framosh Khan, a government official in the surrounding area. Locals reported seeing them carrying the bodies of 15 dead fighters, he said. Two anti-Taliban militiamen were also killed in the fighting.

Pakistani soldiers managed to free dozens of villagers who were taken hostage by the militants or were trapped in their homes during the fighting, said Khan.

The information could not be independently verified because the area is largely off-limits to reporters.

Elsewhere in the country, a bomb exploded on Friday near a political rally in the southwestern city of Quetta, killing at least five people, officials said.

The bombing appeared to target a rally being held by the Awami National Party, which has been attacked many times before because of its opposition to Islamist militants.

No group has yet claimed responsibility for the attack.

In addition to the five people killed, 11 others were wounded, said Mohammed Jafar, a doctor at the city's main hospital. Most of the victims were attending the political rally when the bomb went off.

Quetta is the capital of Baluchistan province, home to both Islamist militants and Baluch nationalists who have been waging a decades-long insurgency against the government for greater autonomy and a larger share of the province's natural resources.

Comment on this story

In southern Pakistan, prisoners at a jail in Hyderabad city took 15 staff hostage and tried to break out of the facility, said senior prison official Gulzar Channa. Guards opened fire on the prisoners to prevent them from escaping, killing one of them. Officials are trying to get the prisoners to release the hostages and go back to their cells, said Channa.

Several Islamist militants convicted in connection with the kidnapping and murder of Wall Street Journal reporter Daniel Pearl in 2002 are held in the jail.

Associated Press writer Abdul Sattar in Quetta, Pakistan, and Munir Ahmed and Zarar Khan in Islamabad contributed to this report.