ANKARA, Turkey — Turkey’s president on Thursday threatened to “open the gates” and allow a flood of Syrian refugees to leave Turkey for Western countries unless a so-called “safe zone” is established inside Syria soon in negotiations with the Americans.

Recep Tayyip Erdogan, in a speech to his ruling party officials, lamented what he described as Turkey being left to shoulder the burden of Syrian refugees alone.

Turkey is determined to create the safe zone inside Syria, along its border with the war-torn country, and was ready to do it alone before the end of the month if there is no agreement with the United States.

"We will be forced to open the gates. We cannot be forced to handle the burden alone," Erdogan said, reiterating Turkey's annoyance that past proposals for the creation of the safe zone — envisioned as a place where refugees could be re-settled — has been ignored by Western nations.

"We did not receive the support needed from the world and especially from the European Union, concerning the burden-sharing," he said.

Turkey opened its borders to Syrians in April 2011 and is currently home to 3.6 million who fled the civil war, now in its ninth year. But as Turkey suffers an economic downturn and rising unemployment, calls among Turks for Syrians to go home are growing.

Hundreds of Syrian refugees have been detained and reportedly forcibly deported to Syria recently , according to accounts by refugees. The Turkish government categorically denies reports of forced deportations.

Turkey reached a deal with the European Union in March 2016 under which Turkey would stem the flow of migrants into Europe in return for funds to help support the refugees and visa-free travel for Turkish citizens. But Erdogan accuses European nations of not keeping to its side of the bargain and has frequently threatened to back away from the deal.

In Brussels, European Commission spokeswoman Natasha Bertaud told reporters that both Turkey and the EU were committed to the deal.

"We trust that we can continue this work in good faith with our Turkish partners," she said.

She said the EU is "providing substantial support to improve the living conditions and protection standards of Syrian refugees in Turkey. To date, the EU has allocated 5.6 billion euros out of the 6 billion that was agreed, with the remaining balance due to be allocated shortly."

Turkey and the United States have been engaged in talks to establish a safe zone inside Syria east of the Euphrates River and even set up a joint operations center in Turkey's border province of Sanliurfa to coordinate their efforts. They have also carried out joint helicopter patrols, including one on Thursday, according to Turkey's military.

But Erdogan said differences remain with Washington on what the safe zone would look like. He did not elaborate.

"We are determined to start the creation of a safe zone east of the Euphrates in the way we want it by the last week of September," he said, adding that "the most ideal way would be for us to do this with our American friends, but if there is no such ground ... we will start doing it with our own means."

Erdogan said Turkey aims to resettle about 1 million out of the 3.6 million Syrian refugees in the safe zone.

Ankara wants U.S.-backed Syrian Kurdish fighters, Washington’s key allies in the fight against the Islamic State group, to pull back from the border area and out of the safe zone. Erdogan said last week that Turkish officials had “temporarily” agreed to a safe zone proposed by the U.S. that is narrower than 20 miles (32 kilometers).

Turkey considers the U.S.-allied Syrian Kurdish fighters terrorists, linked to a Kurdish insurgency within Turkey.