TEHRAN, Iran — With Turkey’s president by his side, Iranian President Hassan Rouhani pledged Wednesday that they would ensure borders in the region remain unchanged after the recent Kurdish independence referendum in Iraq.

Both Iran and Turkey opposed the referendum, which overwhelmingly passed last week, and have sent troops to their borders with the Iraqi Kurdish region. Iraq’s central government also staunchly opposed the vote.

“We will not accept changing borders in the region,” Rouhani said at a news conference with Turkish President Recep Tayyip Erdogan.

“The wrong decisions made by some of the leaders of this region must be compensated for by them.” Rouhani said. “Turkey, Iran and Iraq have no choice but to take serious and necessary measures to protect their strategic goals in the region.”

“A development of this sort will isolate the Kurdish regional government,” Erdogan warned. “Our determination in this regard is clear. We correspond with the central government in Iraq and as far as we are concerned, this referendum is illegitimate.”

“There is no country other than Israel that recognizes it. It is not possible for any decision taken after discussions with Mossad to be legal,” Erdogan said, referring to the Israeli spy agency.

Erdogan added: “From this moment onward, more decisive steps will be taken. As Iran and Turkey — and the central government — there are still heavier steps for us to take.” He did not elaborate.

The nonbinding referendum — in which the Kurds voted more than 90 percent in favor of a break with Iraq — will not immediately result in independence. But Kurdish leaders have said they will use it to press for negotiations on eventually forming their own state.

That has set off alarm bells in Baghdad, where the government has said it is determined to prevent a breakup of the country, and in Iraq’s neighbors, Iran and Turkey, which fear the vote will fuel similar ambitions among their own Kurdish populations.

A flight ban halted all international flights from servicing the Iraqi Kurdish territory’s airports on Friday.

Associated Press writer Suzan Fraser in Ankara, Turkey, contributed to this report.