Gültan Kışanak, a former member of parliament before her election as mayor in Diyarbakır and Fırat Anlı, her co-mayor, were taken into custody as part of an investigation into terrorism links, the local prosecutor said in a statement.
Police were also searching the mayor's office, security sources said. An aide to Kışanak said the mayor's home was being searched by police but was unable to provide further details.
Kışanak, 55, is a well-known political figure and became Diyarbakır's first female mayor in 2014. Earlier on Tuesday, she testified upon the invitation of lawmakers at a parliamentary commission in Ankara looking into a failed military coup on July 15.
It was not immediately clear whether her testimony was related to the detention order. Kışanak was detained upon her return to Diyarbakır at the airport, while Anlı was detained at his home, sources said.