ANKARA, Turkey — Turkey warned Greece on Monday to refrain from “provocations” after a Greek flag was hoisted on a disputed, uninhabited islet in the Aegean Sea off the Turkish coast.

Prime Minister Binali Yildirim told reporters that the Turkish coast guards had removed the flag from the island off the coast of the Aegean resort of Didim.

Yildirim said the incident was similar to one in 1996 when the two NATO allies went to war over uninhabited islets — known as Imia in Greek and Kardak in Turkish — which both Turkey and Greece claim.

“Our advice to Greece would be to stay away from provocations and agitations,” Yildirim said adding that Turkey was “determined to give the necessary response” to such acts.

Despite two decades of efforts to improve relations, Greece and Turkey have seen a spike in tensions in recent weeks over disputed Aegean boundaries as well as over oil-and-gas drilling rights off the divided island of Cyprus.

Asked about the incident during a joint news conference with visiting the NATO chief, Turkish Foreign Minister Cavusoglu accused Greece’s defense minister — the outspoken leader of Greece’s nationalist party — of raising tensions in the Aegean Sea.

“His brattiness shouldn’t reach a level where it’ll damage relations between the two countries,” Cavusoglu said.

In Athens, Greek government spokesman Dimitris Tzannakopoulos said the government had no knowledge of the incident and described the remarks by Yildirim as “provocative and reprehensible.”

“I think Mr. Yildirim should be more careful,” Tzannakopoulos said. “We call on Turkey to return to a path of respect for international law … They should take an initiative to de-escalate the tension.”