Turkey's president has lashed out at the United States a week after a President Barack Obama's envoy visited a northern Syrian town that is under the control of Syrian Kurdish forces, which Ankara considers terrorists.

In comments published Sunday, Prime Minister Recep Tayyip Erdogan said Washington should choose between Turkey and the Kurdish Democratic Union Party, or PYD, as its partner.

That came after envoy Brett McGurk's visit to Kobani, where the PYD's military wing, aided by U.S.-led airstrikes, drove back Islamic State militants a year ago. Turkey considers PYD a terror group because of its affiliation with Turkey's outlawed Kurdistan Workers' Party, or PKK.

Erdogan said: "How can we trust you? Is it me that is your partner or is it the terrorists in Kobani?"