Iran says it has hit a militant group in western Pakistan in a missile attack, its third air strike on another country this week after earlier attacks on targets in Iraq and Syria.
Iranian state TV said the operation hit two sites in Balochistan linked to the militant group Jaish al-Adl.
Pakistani officials said two children were killed and three others injured.
Islamabad said the air strike was an "illegal act" and warned it could lead to "serious consequences".
The latest air strike come at a time of growing tension across the Middle East, with more than 100 days of war between Israel and the Palestinian group Hamas in Gaza and recent US-UK air strikes on Yemen, from where Iran-backed Houthi militants have been attacking commercial shipping in the Red Sea.
China on Wednesday urged Pakistan and Iran to show "restraint" and "avoid actions that would lead to an escalation of tension". Foreign ministry spokesperson Mao Ning added that Beijing saw the countries as "close neighbours".
Tuesday's strike in Pakistan hit a village in the vast south-western border province of Balochistan. Tehran said it was targeting Jaish al-Adl, or "army of justice", an ethnic Baloch Sunni Muslim group that has carried out attacks inside Iran as well as on Pakistani government forces.
Late on Monday Iran launched fired ballistic missiles against targets in Iraq's northern city of Irbil, prompting condemnation by the US. Iran's Revolutionary Guards said they struck what they claimed were an Israeli "spy headquarters" in Iraq's semi-autonomous Kurdistan Region. Four civilians were killed and six hurt in the attack, local authorities said.
Iran then hit targets in Syria's north-western Idlib province, which is the last remaining opposition stronghold in the country, outside of Syrian government control, and is home to 2.9 million displaced people, many of whom are living in dire conditions in camps.
Iran's Revolutionary Guards said the strikes in Syria were in retaliation for this month's suicide bombing that killed 84 as crowds marked the fourth anniversary of Iranian general Qasem Soleimani's assassination by the US.
Tehran has declared that it does not want to get involved in a wider conflict emanating from the war in Gaza. But groups in its so-called "Axis of Resistance", which include the Houthis, Hamas in Gaza, Hezbollah in Lebanon and various groups in Syria and Iraq, have been carrying out attacks on Israel and its allies to show solidarity with the Palestinians.
Following the attack on its territory, Pakistan condemned what it called an "unprovoked violation of its airspace by Iran". It said it was "even more concerning that this illegal act has taken place despite the existence of several channels of communication between Pakistan and Iran".
Pakistan and Iran's relationship is delicate but cordial. This attack took place on the same day as Pakistan's prime minister and Iran's foreign minister met in Davos and while the Iranian and Pakistan navies held military drills together in the Gulf.
Yet both have accused one another of harbouring militant groups that carry out attacks on the other in their border areas for years. In 2017 the Pakistan foreign ministry said that an Iranian drone was shot down as it was inside Pakistan territory, and in 2014 Iranian security forces crossed the border to pursue militants.
In 2013 media reports in Pakistan said a rocket that came from Iran had killed a girl in the border area.
Security on either side of their shared border, which runs for about 900km (559 miles), has been a long-running concern for both governments.
Tehran has linked Jaish al-Adl with attacks last month close to the border, which killed more than a dozen Iranian police officers.
At the time, Iran's interior minister Ahmad Vahidi said the militants responsible had entered the country from Pakistan.
Jaish al-Adl is the "most active and influential" Sunni militant group operating in Sistan-Baluchestan, according to the office of the US Director of National Intelligence. It is designated as a terrorist group by Washington and Tehran.