Turkish President Recep Tayyip Erdogan says his government will not reveal details of a covert operation that ensured the release of 49 people held hostage by the Islamic State group.

The hostages — 46 Turks and three Iraqis — were seized in Mosul, Iraq when militants overran the city in June. They were released and returned to Turkey on Saturday.

Turkey says no ransom was paid and no promises were made but it remains unclear why the IS agreed to let them go.

Erdogan was addressing some of the hostages and their families on Sunday, saying: "There are things we cannot talk about. To run the state is not like running a grocery store. We have to protect sensitive issues, if you don't there would be a price to pay."