Turkey and Iran have agreed to boost military cooperation after talks in Ankara this week between the Iranian armed forces chief of staff and Turkish leaders, President Tayyip Erdogan's spokesman said on Thursday.

Erdogan, his defence minister and military chief of staff met Iranian General Mohammad Baqeri on Tuesday and Wednesday. It was the first visit to Turkey by the head of Iran's military since the 1979 revolution, Turkish media said.

Spokesman Ibrahim Kalin also said the U.S. Secretary of Defense Jim Mattis would visit Turkey in a few days.