ANKARA, Turkey  For decades, Turkey was one of the United States’ most pliable allies, a strategic border state on the edge of the Middle East that reliably followed American policy. But recently, it has asserted a new approach in the region, its words and methods as likely to provoke Washington as to advance its own interests.

The change in Turkey’s policy burst into public view last week, after the deadly Israeli commando raid on a Turkish flotilla, which nearly severed relations with Israel, Turkey’s longtime ally. Just a month ago, Turkey infuriated the United States when it announced that along with Brazil, it had struck a deal with Iran to ease a nuclear standoff, and on Tuesday it warmly welcomed Iran’s president, Mahmoud Ahmadinejad, and the Russian prime minister, Vladimir V. Putin, at a regional security summit meeting in Istanbul.

Turkey’s shifting foreign policy is making its prime minister, Recep Tayyip Erdogan, a hero to the Arab world, and is openly challenging the way the United States manages its two most pressing issues in the region, Iran’s nuclear program and the Israeli-Palestinian peace process.

Turkey is seen increasingly in Washington as “running around the region doing things that are at cross-purposes to what the big powers in the region want,” said Steven A. Cook, a scholar with the Council on Foreign Relations. The question being asked, he said, is “How do we keep the Turks in their lane?”