As it builds a coalition to confront the Islamic State, the Obama administration is showering renewed attention on Turkey, which has had chilly relations with Washington of late but whose cooperation is vital to combat the Islamist extremists in Iraq and Syria.

Defense Secretary Chuck Hagel landed here in the Turkish capital Monday to strategize with President Recep Tayyip Erdogan and other top officials — just three days after the Pentagon chief and President Obama met with Erdogan at a NATO summit in Wales and persuaded him to join a U.S.-led coalition against the Islamic State.

The sudden burst of high-level diplomacy is striking because Turkey and the United States had been giving each other the cold shoulder over the past 18 months. During Obama’s first term in office, he and Erdogan were on chummy terms, speaking almost monthly. But the relationship soured last year after Erdogan ordered blunt force to disperse massive street protests and clamped down on political opponents.

Hagel canceled a trip to Turkey in January. His visit Monday was the first by a U.S. defense secretary since December 2011 — an unusually long stretch given the long-standing military ties between the two countries and their status as NATO allies for more than half a century. The Pentagon also has an Air Force wing stationed at Incirlik Air Base in Turkey.

“Yes, we’ve had our ups and downs in that relationship, but what’s interesting is it’s never broken,” Hagel told reporters Monday. The emergence of the Islamic State, he added, has prompted the allies to patch up differences.

Turkey signed up for Obama’s “core coalition” against the Islamic State on Friday at the NATO summit — the only Muslim country in the group. But its leaders have indicated that they are reluctant to take a visible role, worried that any overt Turkish military action could endanger 49 Turkish citizens whom the extremist group is holding hostage.

Although Turkey does not publicly acknowledge the activity, the U.S. military has been flying unarmed surveillance drones over Iraq from Incirlik Air Base. Turkey has been holding the line at authorizing airstrikes or combat missions from its territory.

Obama has said that the United States needs Turkey to help control the flow of foreign fighters who have swelled the ranks of the Islamic State; many travel from Europe or North Africa to Turkey and then to Syria and Iraq.

Militarily, U.S. officials said they need more help in the region with refueling flights, airlifting equipment and supplies, and providing assistance to moderate Syrian rebel groups.

The purpose of Hagel’s visit was “really to see how far they’re willing to go,” a senior U.S. defense official said, speaking on the condition of anonymity to discuss military planning. “Turkey, by the fact of its geography, is inevitably a partner. It’s got to be a partner. It won’t work without Turkey.”

In his meetings with Erdogan and other Turkish leaders, Hagel said, they explored what roles Turkey might fill, though he declined to give details.

“Turkey has its specific concerns and issues,” he said. “Each country has its own separate limitations, its own separate political dimensions. We have to respect those.”

1 of 62 Full Screen Autoplay Close Sept. 14, 2014 Sept. 12, 2014 Sept. 10, 2014 Sept. 9, 2014 Sept. 8, 2014 Sept. 7, 2014 Sept. 6, 2014 Sept. 5, 2014 Sept. 4, 2014 Sept. 3, 2014 Skip Ad × Pushing back the Islamic State View Photos Government forces and Shiite militias launch counterattack to reclaim territories taken by the militants. Caption Government forces and Shiite militias launch counterattack to reclaim territories taken by the militants. Sept. 15, 2014 Iranian Kurdish female members of the Freedom Party of Kurdistan (PAK) sit with their weapons during a training session in Dibis, about 30 miles northwest of Kirkuk, Iraq. The world's top diplomats pledged today to support Iraq in its fight against Islamic State militants. Safin Hamed/AFP/Getty Images Buy Photo Wait 1 second to continue.

Turkish leaders have said that they are already bearing an enormous burden from instability in Iraq and Syria, including hosting about 800,000 Syrian refugees. Officials in Ankara also worry that the Islamic State could shift its focus from Iraq and Syria and launch attacks on Turkish territory.

Erdogan has said that Turkey has cracked down on foreign fighters but needs better intelligence from capitals in Europe and other places where the recruits come from. Turkish officials have also griped that Obama has been slow to act in Syria, enabling President Bashar al-Assad to survive the long-running civil war there.

Another source of disagreement has been the U.S. push to arm Kurdish fighters battling the Islamic State in northern Iraq; Turkey has a large Kurdish minority and is afraid that the weapons could end up in the hands of Kurdish guerrillas it has fought for decades.

Overcoming differences between Washington and Ankara has been made tougher by the absence of a U.S. ambassador to Turkey for the past two months. Obama nominated John R. Bass, a career diplomat, in early June. Bass is still awaiting confirmation from the Senate, where Republicans have held up a long list of would-be ambassadors as part of a larger political squabble.

To fill the void, the State Department announced late last week that it would send Ross Wilson, a retired U.S. diplomat and former ambassador to Turkey, back to Ankara to fill in temporarily. Wilson arrived Saturday, just in time to escort Hagel to his meetings.