Iranian President Mahmoud Ahmadinejad expressed support for Turkey’s retaliatory cross-border artillery strikes against Syria — Tehran’s ostensibly ally, Turkish media reported on Wednesday.

Ahmadinejad held a surprise meeting with Turkish Prime Minister Recep Tayyip Erdoğan in the Azeri capital of Baku on Tuesday. During the 40-minute meeting, the two heads of state discussed the devolving situation in Syria.

Turkish daily Hürriyet reported that Erdoğan defended Turkey’s decision to retaliate against Syrian shelling of a border town that killed five Turkish civilians on October 3. According to the paper, Ahmadinejad “showed support for Turkey regarding the incident and said Tehran will ‘continue to support’ Ankara on this issue.”

Turkish newspaper Sabah quoted Ahmadinejad saying, “You are definitely in the right when it comes to this matter, and we support you.”

If true, the statement marks a surprising about face in Iran’s relationship to Dasmascus, which it has backed throughout the country’s 19-month civil war.

Iran and Turkey are close economic allies and the two countries have grown closer as Ankara has moved away from Israel in recent years.

“The circumstances of the whole meeting… signal a growing Iranian isolation and seemingly a wish to maintain reasonable relations with Ankara,” Alon Liel, former director of the Ministry of Foreign Affairs and author of several books on Turkish politics, told the Times of Israel.

“Relations with Turkey, a regional economic power, are especially important [for Iran] after the recent European Union sanctions. If the EU sanctions will be effective, Assad might be the first leader to pay the price.”

Turkey and Syria, once close allies, have exchanged border fire for several weeks as tensions between the countries have mounted.

The Turkish military on Wednesday fired at targets in Syria from a base near the border town of Hacıpaşa in response to a Syrian mortar shell landing in the Turkish border province of Hatay.

The provincial governor’s office reported no injuries in the shelling, according to Turkey’s official Anadolu news agency.

There were no reports of injuries in Syria as a result of Turkey’s retaliatory fire.

Turkey has retaliated against cross-border artillery fire in the past two weeks, but few casualties have been reported.