Converting the Hagia Sophia into a mosque is a matter of sovereignty, Turkey's president told reporters on Friday.
Turkey does not see international reactions on the reopening of the Istanbul landmark to Muslim worship as binding, Recep Tayyip Erdoğan stressed.
The first prayers will be held on July 24 for 1,000-1,500 worshipers at the same time, Erdoğan added.
- Azerbaijan-Armenia conflict
"Turkey will never leave Azerbaijan alone," Erdoğan said, following recent cross-border artillery fire by Armenia attack.
"Nakhchivan is under occupation. The Minsk trio has left the issue on the table for 25-30 years," he added.
Last Sunday, the Armenian army attempted to attack Azerbaijani positions with artillery fire towards the northwestern Tovuz border district, withdrawing after suffering losses following retaliation from the Azerbaijani military.
Eleven Azerbaijani soldiers -- including a major general and a colonel -- were martyred in the clashes that injured four others.
Despite international calls for restraint, Armenian troops also opened fire on residential areas in the villages of Agdam and Dondar Kuscu. A 76-year-old Azerbaijani man lost his life in the attacks by Armenia, which Baku has accused of hiding losses.
Azerbaijan has blamed Armenia for the "provocative" actions, with Turkey throwing its weight behind Baku and warning Yerevan that it would not hesitate to stand against any kind of attack on its eastern neighbor.
The Armenian military in 1991 illegally occupied the Upper Karabakh region, an internationally recognized territory of Azerbaijan.
Four UN Security Council and two UN General Assembly resolutions, as well as decisions by many international organizations, refer to this fact and demand the withdrawal of the occupational Armenian forces from Upper Karabakh and seven other occupied regions of Azerbaijan.