“I recognize that in some cases, the PKK has fought against [IS], but they are a foreign terrorist organization,” Kirby said. “And our fight against [IS] is not in cooperation with, coordination with or communication with the PKK.”

“Turkey has continued to come under attack by PKK [Kurdistan Workers Party] terrorists, and we recognize their right to defend themselves against those attacks,” State Department spokesman John Kirby said after Turkey bombed the outlawed Kurdish militant group’s bases in northern Iraq late last month.

The Barack Obama administration has been willing to give Ankara the benefit of the doubt — for now.

Ankara is earning kudos for finally allowing US warplanes to use Turkish air bases for bombing runs against IS after months of growing pressure. But President Recep Tayyip Erdogan has also made it clear that he sees Kurdish militants as an existential threat that he is determined to take out.

Turkey is engaged in a delicate diplomatic dance as it tries to convince the United States to abandon some of its best allies against the self-proclaimed Islamic State (IS).

Still, the resumption of hostilities between Turkey and the PKK after two years of peace talks further complicates the Obama administration’s foundering strategy to defeat IS. The PKK isn’t part of the official Kurdistan Regional Government and its Peshmerga militia in northern Iraq, but the two have joined forces to combat IS.

The strikes have outraged US allies in both Baghdad and the Iraqi Kurdish capital of Erbil. The attacks are also a blow to the US-allied Syrian Kurdish Democratic Union Party, one the most successful groups battling IS in Syria, which Ankara considers a PKK front group but Washington does not.

To help manage the US relationship, Turkey can count on a finely tuned lobbying campaign. The $3 million-a-year effort has helped smooth over tensions in recent years as Congress and the Obama administration have grown increasingly worried about Turkey’s authoritarian drift under Erdogan and its discreet support for Islamist fighters in Syria.

The lobbying push is led by former House Majority Leader Richard Gephardt, D-Mo., and his Gephardt Group. The group and its four subcontractors on the Turkey account get paid $1.4 million a year.

Ankara scored a coup in April when one of those firms, Dickstein Shapiro, hired former CIA director Porter Goss to lobby for Turkey. The ex-spy chief will use his wealth of contacts to assist the country on issues of “trade, energy security, counterterrorism efforts and efforts to build regional stability in the broader Middle East and Europe.”

The Turkish Embassy in Washington, meanwhile, has hired former Turkish national swimming champion Huma Gruaz and her Chicago-based Alpaytac public relations firm to provide “public relations and communications services” for $1.42 million a year. And Col. Ferah Ozbek, a Virginia-based liaison to the United States for the government-owned STM defense company, received $98,000 last year from the National Defense Ministry’s undersecretariat for defense industry to “create business opportunities” for the Turkish defense industry.

In addition, Turkey receives support from the Turkish Coalition of America (TCA).

While the privately funded group doesn’t work for the Turkish government, it provides an assist on issues of concern to the estimated 500,000 Turkish Americans. The organization is also one of the biggest private sponsors of travel for lawmakers and their staff, having organized 178 trips worth a total of $1.13 million since 2007, while its Political Action Committee gave $64,100 to federal political candidates and committees in the six months to June 30.

The TCA was founded in 2007 by Massachusetts microchip millionaire Yalcin Ayalsi, whose family has made hundreds of thousands of dollars in political contributions over the years to members of the 144-member Congressional Caucus on US-Turkish Relations and Turkish Americans. The caucus is co-chaired by Reps. Ed Whitfield, R-Ky.; Virginia Foxx, R-N.C.; Steve Cohen, D-Tenn.; and Gerald Connolly, D-Va.

Efforts to restrain the widespread bipartisan support for the Kurds have partly paid off.

The Senate in June defeated 54-45 an amendment to the annual defense bill from Sen. Joni Ernst, R-Iowa, that would have required the United States to “directly” provide military support to the Iraqi Kurds. A similar House bill from Foreign Affairs Chairman Ed Royce, R-Calif., has gone nowhere.

While the Iraqi government has openly opposed such efforts, Turkey has also played a discreet behind-the-scenes role. When Royce first introduced his bill last year, Turkey lobbyist Dickstein Shapiro met with the national security aide to House Majority Leader Kevin McCarthy, R-Calif., and emailed staff for Majority Whip Steve Scalise, R-La., to discuss the issue, according to lobbying filings.

Turkey’s biggest lobbying win this year was without a doubt over Armenia.

On the centenary of the 1915 massacres against the Ottoman Empire’s Christian minority, the Turks convinced President Barack Obama to avoid any mention of the word “genocide” despite his campaign promise to do so. House and Senate leaders, meanwhile, never brought up genocide resolutions following an intense campaign by Turkey that included efforts to paint Armenia as a friend of Iran and Russia.

Ankara is also benefiting from stepped-up military assistance.

The State Department last summer cleared a $320 million sale of advanced air-to-air missiles. And its foreign aid request for the next fiscal year sets aside $3.2 million for military education and training — the third-largest bilateral allocation for the program globally, according to the State Department.

The Obama administration, however, has balked at supporting Turkey’s proposal for a “safe zone” across the border in southern Syria. The Kurds, meanwhile, fear the proposal is a trick to deny them an autonomous state.

The issue is further complicated by its implications for domestic Turkish politics. Critics of Erdogan’s crackdown on the PKK see it as little more than an excuse to weaken the pro-Kurdish Peoples’ Democratic Party (HDP), which robbed his Justice and Development Party of its majority in the June elections.

Wary of pushing the increasingly authoritarian leader into a corner, Congress has tried swapping a confrontational approach for more collaboration. In March, Foreign Affairs Committee member Bill Keating, D-Mass., unveiled a proposal to create a “formal dialogue” with Ankara on strengthening political freedoms — so far, to no avail.

“To remain silent on all of this could create the impression that we acquiesce — and we don't," Keating told Al-Monitor. "And if there's going to be joint efforts economically and on other fronts, these are issues that have to be discussed."