Turkish President Recep Tayyip Erdogan said Thursday that the United States has given weapons to a terrorist group in Syria despite Turkish opposition.

Erdogan said the U.S. had armed the Democratic Union Party, or PYD, which he said is affiliated with the Kurdistan Workers' Party, or PKK.

The PKK, a pro-Kurdish Turkish party is outlawed in Turkey, and is considered a terrorist group by Turkey, the U.S. and the European Union.

That means, Erdogan said, that the U.S. has helped arm a terrorist organization. 

The Democratic Union Party is fighting against ISIL, the Islamic State of Iraq and the Levant -- which is also a terrorist organization.

"We had said that there are commanders from the PKK in the ranks of PYD fighting in Syria," Erdogan said in a joint press conference in Riga with his Latvian counterpart, Andris Berzins. "We had said that any U.S. aid to this group is going to a terrorist organization."

The U.S. airdropped 27 bundles of weapons, ammunition and medical supplies to the Democratic Union Party on Monday. U.S. officials had notified Turkish officials in advance.

ISIL got some of the weapons, however, as the militant group has shown on its website.

"Some of those weapons were seized by ISIL terrorists," Erdogan said. "But the rest, they also were seized by another terrorist organization, the PYD. Turkey did never lean towards such military aid and the U.S. did that despite Turkey."

Kobani, also known as Ayn al-Arab, is currently under the control of the People’s Protection Units -- the armed wing of the Democratic Union Party.

The Syrian-Turkish border town has been the scene of fierce battles between Kurdish groups and ISIL since mid-September.

The Turkish president asked the U.S. government to recognize the "dilemmas" in Kobani, which is just across the border from Turkey.

"Kobani is not strategic for the U.S.," he said. "It could be strategic for us only. And also, Turkey is currently accommodating all the civilians fleeing from the town. There are no civilians there."

An estimated 1.5 million Syrian refugees, including around 200,000 from Kobani, are living in refugee camps across Turkey.

Erdogan said the Syrian groups that should be helped are the Free Syrian Army and peshmerga fighters from the northern Iraqi Kurdish autonomus administration.

"I made that offer regarding the passage of Peshmerga into northern Syria from Turkey," Erdogan said. "We allowed them to enter Syria under the control of Turkish security forces."

He criticized the Democratic Union Party's reluctance to agree to having peshmerga forces fight alongside them against ISIL. The Democratic Union Party and the Kurdish Regional Government of Iraq finally agreed Wednesday on allowing peshmerga fighters into Kobani.

"At first they did not accept the peshmerga's coming to help," Erdogan said. "Then they accepted. After that they did not like the number of troops that would come. Only afterwards the sides negotiated on the arrival of 200 peshmerga."

The Democratic Union Party is the only Syrian Kurdish Party not under the umbrella of the Kurdish National Coalition, formed through the efforts of Kurdish Regional Government President Massoud Barzani.

Yet it is the most dominant Kurdish group among some 15 Kurdish parties in the region.

The Barzani administration and the Kurdish National Coalition have never accepted the unilateral formation of autonomous units by the Democratic Union Party in northern Syria, demanding that the authority should be shared between all other Kurdish groups.

Anadolu Agency