ANKARA - President Recep Tayyip Erdogan warned on Tuesday that Turkey would bring the curtain down on its over half-century bid to join the European Union if new accession chapters were not opened.

Erdogan’s threat to say “goodbye” to the EU came just minutes after he rejoined Turkey’s ruling party in the first major change to take effect following a controversial vote to boost his powers.

Relations between Ankara and Brussels have tumbled to unprecedented lows following a failed military coup against Erdogan in July.

The EU is troubled by the state of human rights in Turkey, particularly after widespread purges, while Ankara has lashed out at what it sees as a lack of solidarity from the bloc. Erdogan last month narrowly won a referendum on sweeping consitutional changes to create a presidential system. But the victory was contested by the opposition and received only the most tepid of welcomes in Brussels.

“There is no option other than opening chapters that you have not opened until now,” Erdogan said, referring to the individual policy areas that need to be concluded before Turkey joins the EU. “If you open, then great. If you don’t open, then goodbye,” Erdogan said. “Turkey is not their (the EU’s) doorman.”

Sixteen chapters have been opened out of a total of 35 since accession talks began in October 2005, although Turkey’s bid to be a part of the bloc dates back to the 1960s. “First you have to handle these chapters and fulfil your promises. Then we will sit at the able and talk. Otherwise, we have nothing left to discuss with you,” Erdogan said.

Some EU states - led by Austria - have suggested that membership talks should be frozen. But EU foreign affairs chief Federica Mogherini said on Friday that negotiations had not been halted and German Foreign Minister Sigmar Gabriel also said that Berlin was “strictly against breaking off the accession talks.”

Turkish Foreign Minister Mevlut Cavusoglu, in an interview with A Haber TV, indicated that Erdogan would finally meet top EU officials when he travels to Brussels for the May 24-25 NATO summit.

“Later, there will be a big summit, a Turkey-EU summit. The timing will be clear after the talks on the NATO margins,” Cavusoglu added.

Erdogan, who Monday returned from a visit to India, will however first be visiting Russia, China and United States in an indication of Turkey’s priorities.

Erdogan made the warning to the EU in a key policy speech that followed his formal return to the ruling Justice and Development Party (AKP).

Under Turkey’s former constitution, the head of state had to sever ties with their political party and Erdogan had to leave the AKP when he became president in August 2014 after more than a decade as premier.

The reforms permit the president to be a member of a political party, allowing Erdogan to return to the AKP which he co-founded in 2001 as a new Islamic-rooted force in Turkish politics and which has dominated the scene ever since.

Supporters of the changes say they will bring Turkey efficient governance but opponents fear they will set the country on the path to authoritarian rule.

Erdogan was welcomed as a new member at a special ceremony at party headquarters in Ankara attended by hundreds of AKP officials led by Prime Minister Binali Yildirim. Erdogan, who has four children, has described the AKP as his “fifth child” and has never made a secret of his desire to return to the fold.

“I was forced to leave the party I co-founded, my home, my love. This longing is thankfully coming to an end,” he told the officials, some of whom were in tears.

“I am a member of my party again. This was just an official separation. Our hearts are together, always together.” He is keen to sharpen the party’s performance ahead of polls scheduled for 2019, after the ‘No’ vote came out on top in key battlegrounds in the April 16 referendum including Ankara and Istanbul.

Yildirim confirmed that Erdogan will also be reinstalled as party chairman on May 21 at an extraordinary AKP congress.

The new constitution envisages major changes including the abolition of the premier’s post and giving the head of state power to appoint ministers.

But these changes will only come into force after elections scheduled for November 2019 and the party membership shift is one of the few measures to take effect before then.