The EU says Turkey needs to narrow its definition of terrorism to qualify for visa-free travel – which is part of a larger deal between the sides aimed at easing Europe’s migration crisis.
Mr Erdogan was speaking a day after PM Ahmet Davutoglu, who largely negotiated the EU deal, said he was stepping down.
Mr Davutoglu had also reportedly opposed Mr Erdogan’s plan to give more power to the presidency. Mr Erdogan said the proposed constitutional changes were a national need, not a personal requirement.
The wide-ranging EU-Turkey deal involves the return of migrants, mainly Syrians, from Greece to Turkey, along with increased aid and other measures.
One of these is to allow Turkish citizens visa-free travel for short stays in the EU’s Schengen area which comprises 22 EU and four non-EU members.
However, the EU wants Turkey to narrow its broad definition of terrorism to match tighter EU standards. It is one of five EU criteria Turkey still has to agree to in order to meet the visa-free requirements.
Mr Erdogan rejected this, saying in a televised speech on Friday: “Turkey, when it’s under attack from terrorist organisations from all sides, the European Union is telling us to change the anti-terror law in exchange for the visa deal.”
Referring to tents erected by the outlawed Kurdistan Workers’ Party, or PKK, near the EU parliament in Brussels, Mr Erdogan said: “You [the EU] will let terrorists build tents and provide them with opportunities in the name of democracy.
“And then [you] will tell us ‘if you change this [anti-terrorism legislation], I will lift the visas’. Sorry, we’ll go our way, you go yours.”
BBC Turkey correspondent Mark Lowen says Mr Erdogan’s hard rhetoric will please his support base but will alarm European leaders.
In recent months, he says, the government has used the terms “terrorist” or “terrorist supporter” to prosecute critics including journalists, suggesting they are supporting Kurdish militants or other armed organisations.
If Mr Erdogan does not meet the EU requirements, the European Parliament and EU leaders will not vote on the visa waiver at the end of June and, our correspondent says, the whole deal could fall apart.
Another part of the EU-Turkey deal had been to hold new talks on Turkish accession to the EU.
But analysts say Mr Erdogan has been less convinced of EU alignment than Mr Davutoglu, and he will certainly be a tougher negotiator.
On Thursday, Mr Davutoglu, who was hand-picked by Mr Erdogan to succeed him as head of the governing AK Party after Mr Erdogan was elected president in 2014, said he would not stand again as leader at an extraordinary party congress called for 22 May.
Our correspondent says Mr Davutoglu had not been the pliant PM Mr Erdogan had hoped for, and the resignation is a tightening of control by the president.