Uniformed men identified as U.S. Special Operations forces ride in the back of a pickup truck in the village of Fatisah in the northern Syrian province of Raqqa on Monday. (Delil Souleiman/AFP/Getty Images)

The U.S. military made a rare admission of wrongdoing Friday after Turkey complained about widely published photographs of U.S. commandos wearing Kurdish militia badges during an offensive targeting the Islamic State near the militants’ Syrian stronghold of Raqqa.

Col. Steve Warren, a U.S. military spokesman, told a Pentagon briefing that it was “unauthorized” and “inappropriate” for the U.S. Special Operations forces to wear the badges bearing the logos of the Kurdish People’s Protection Units (YPG) and its female wing, the YPJ, as they accompanied a Kurdish-led force on a recent operation targeting the Islamic State’s self-proclaimed capital.

His comments followed vociferous complaints from Turkey warning that the apparent demonstration of U.S. support for a group Turkey regards as a terrorist organization would jeopardize ties between Washington and Ankara. The Obama administration needs the cooperation of Turkey, a NATO ally, in the war against the Islamic State and is relying on Turkish support to launch airstrikes on Syria from the Incirlik base in southern Turkey.

Warren indicated that the U.S. forces participating in the operation to capture a stretch of desert territory north of Raqqa will no longer attach the badges to their uniforms, saying that “corrective action” had been taken.

The incident marked a rare Pentagon reversal on the behavior of U.S. troops on the ground and underscored the political tangle that the war against the Islamic State is creating for U.S. allies in the region. Only a day earlier, Warren, as well as chief Pentagon spokesman Peter Cook, had defended the troops’ decision to don the Kurdish badges for the offensive, saying it was “customary” for U.S. soldiers to wear the insignia of their allies in order to “blend in.”

But the YPG is closely tied to the Kurdistan Workers’ Party (PKK), a Turkish Kurdish militant group that has carried out bombings and is fighting Turkish troops in the country’s Kurdish southeast.

The U.S. troops were “wearing the insignia of a terrorist organization, which is responsible for the last two terrorist attacks in Ankara,” Turkish Foreign Minister Mevlut Cavusoglu told reporters Friday, referring to recent bombings in the Turkish capital that have killed nearly 200 people.

The U.S. government also designates the PKK as a terrorist organization but says it regards the YPG as a separate group. The U.S. military has given significant assistance to the YPG to aid its advances against the Islamic State, including the dispatch of 300 Special Operations troops who are now aiding the Raqqa offensive.