The Turks, including diplomatic staff, were seized from the consulate on June 11, when the Islamic State group overran Mosul, Iraq and stormed the Turkish Consulate.
Davutoglu told Turkish reporters during a visit to Baku, Azerbaijan that the hostages were released early on Saturday and had arrived in Turkey. He was cutting his visit short to meet with the hostages in the province of Sanliurfa, near Turkey's border with Syria.
He did not provide details on the circumstances of their release.
"They have crossed into Turkey and I am on my way to see them," Davutoglu said.
