Turkish media quoted Erdogan as saying on Sunday that the country would stand its ground despite Washington's sanctions threat.
"You cannot make Turkey take a step back with sanctions," he said.
The remarks came three days after Trump threatened to "impose large sanctions on Turkey for their long time detainment of Pastor Andrew Brunson." The US president also described Brunson as an "innocent man of faith" who should be released immediately.
The evangelical Christian pastor originally from North Carolina has been held in a Turkish jail for almost two years.
He has been accused of having links with the outlawed Kurdistan Workers' Party (PKK) and the Gulen movement, which Turkey blames for the 2016 failed military coup.
The pastor has denied the charges, but faces up to 35 years in jail if found guilty.
On Wednesday, a Turkish court allowed Brunson to be transferred to house arrest.
Elsewhere in his remarks, Erdogan warned that the dispute over the Brunson case could imperil relations between the US and Turkey, two NATO allies.
"The US should not forget that it could lose a strong and sincere partner like Turkey if it does not change its attitude," he said.
Shortly before Trump's threat, US Vice President Mike Pence urged Turkey to release Brunson "now or be prepared to face the consequences.”
In response, Turkish Foreign Minister Mevlut Cavusoglu said, “No one dictates Turkey. We will never tolerate threats from anybody.”
On Friday, The Washington Post reported a deal between Ankara and Washington to secure the release of Turkish woman Ebru Ozkanon held by Zionist regime in exchange for the freedom of Brunson.
Ozkanon, who was detained on charges of passing hundreds of dollars to the Palestinian resistance movement Hamas, was released recently after a month of detention.
Erdogan, however, stressed that Turkey had "never made Pastor Brunson a bargaining chip" and had just asked for Washington's help in securing Ozkanon's freedom.
"But we didn't say: 'In return for this, we will give you Brunson'. Nothing like this was discussed," he pointed out.