By Asif Shahzad and Gibran Naiyyar Peshimam
ISLAMABAD (Reuters) -Pakistan launched strikes on separatist militants inside Iran on Thursday, in a retaliatory attack two days after Tehran said it struck the bases of another group within Pakistani territory.
Iranian media said several missiles hit a village in the Sistan-Baluchestan province that borders Pakistan, killing at least nine people, including four children.
The tit-for-tat strikes are the highest-profile cross-border intrusions in recent years and have raised alarm over wider instability in the Middle East since the war between Israel and Hamas erupted on Oct. 7.
However, both sides appeared to signal a desire to keep the situation contained. Iran's foreign ministry said on Thursday it was committed to good neighbourly relations with Pakistan, but called on Islamabad to prevent the establishment of "terrorist bases" on its soil.
Pakistan issued a similar statement. "The sole objective of today's act was in pursuit of Pakistan's own security and national interest, which is paramount and cannot be compromised," the foreign ministry said.
"A number of terrorists were killed during the intelligence-based operation," the ministry said, describing the strikes as a "series of highly coordinated and specifically targeted precision military strikes against terrorist hideouts".
Tehran strongly condemned the strikes, saying civilians were killed, and summoned Pakistan's charge d'affaires, its most senior diplomat in Iran, to provide an explanation.
"The information received indicates that four children, three women and two men, who were foreign nationals, have been killed in the explosion that occurred in a village," Iran's Interior Minister Ahmad Vahidi told state TV.
In Islamabad, a foreign ministry spokesperson said Pakistan's caretaker Prime Minister Anwaar-ul-haq Kakar would cut short a visit to the World Economic Forum in Davos and return home.
"The precision strikes were carried out using killer drones, rockets, loitering munitions and stand-off weapons," a Pakistani military statement said. It said the targets were bases used by the Baloch Liberation Front (BLF) and the associated Baloch Liberation Army.
Iran said on Tuesday it had hit targets inside Pakistan that it alleged were bases of Jaish al Adl (JAA). All the targeted groups are ethnically Baloch, but it was not clear if JAA has links with the other two.
Nuclear-armed Pakistan said civilians were hit and two children killed. Islamabad recalled its ambassador from Iran on Wednesday in protest against a "blatant breach" of its sovereignty.
Against the backdrop of the war in Gaza, Iran and its allies had been flexing their muscles in the region, even before its cross-border incursion into Pakistan.
Iran launched strikes on Syria against what Tehran said were Islamic State sites, and Iraq, where it said it had struck an Israeli espionage centre.
The Iran-backed Houthi militia in Yemen have targeted shipping in the Red Sea since November, saying they are acting in solidarity with Palestinians.
Pakistan and Iran had appeared to be improving ties, with Iran's Foreign Minister Hossein Amirabdollahian and Pakistan's Kakar meeting at Davos this week.
But analysts warned of the threat of escalation.
"Iran's motivation for attacking Pakistan remains opaque, but in light of broader Iranian behaviour in the region it can escalate," Asfandyar Mir, a senior expert on South Asia security at the U.S. Institute of Peace, told Reuters.
"What will cause anxiety in Tehran is that Pakistan has crossed a line by hitting inside Iranian territory, a threshold that even the U.S. and Israel have been careful to not breach."
Russia's foreign ministry on Thursday called on Pakistan and Iran to show maximum restraint and solve their differences through diplomacy.
Turkish Foreign Minister Hakan Fidan said after speaking with his counterparts from both countries that neither side wanted to escalate tensions.
The targeted militant groups operate in an area that includes Pakistan's southwestern province of Balochistan and Iran's southeastern Sistan-Baluchestan province. Both are restive, mineral-rich and largely underdeveloped.
The BLF, which Islamabad targeted inside Iran, is waging an armed insurgency against the Pakistani state, including attacks against Chinese citizens and investments in Balochistan.
The Jaish al Adl, which Iran targeted, is also an ethnic militant group, but with Sunni Islamist leanings that primarily Shi'ite Iran sees as a threat.
The group has carried out attacks in Iran against its powerful Revolutionary Guard Corps.
(Additional reporting by Parisa Hafezi and Elwelly Elwelly in Dubai, Charlotte Greenfield, Ariba Shahid; Writing by Raju Gopalakrishnan and Ros Russell; Editing by Clarence Fernandez, Nick Macfie and Bill Berkrot)