The Taliban ruled Afghanistan with an iron fist from 1996 to 2001 and have fought for 20 years to topple the Western-backed government in Kabul and reimpose Islamic rule. They are making a fresh push now to gain territory as foreign forces pull out.
"(The Taliban) need to end the occupation of their brothers' soil and show the world that peace is prevailing in Afghanistan right away," Erdogan told reporters before leaving for a trip to northern Cyprus.
He said the Taliban's approach was not the way that Muslims should deal with each other.
Ankara, which has offered to run and guard Kabul airport in the capital after NATO withdraws, has been in talks with the United States on financial, political and logistical support for the deployment.
Last week the Taliban warned Turkey against those plans to keep some troops in Afghanistan to run the airport, calling the strategy reprehensible and warning of consequences.
"In the statement made by the Taliban there is no phrase 'We don't want Turkey'," Erdogan said when asked about the comments.
Separately, Erdogan said that he hoped to raise in talks with US President Joe Biden at this year's UN General Assembly the issue of international recognition for Kosovo and would propose joint work on the issue to increase the number of countries which recognise it.