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 Erdogan stressed.
The first prayers will be held on July 24 for 1,000-1,500 worshipers at the same time, Erdogan added.
"Turkey will never leave Azerbaijan alone," Erdogan said, following recent cross-border artillery fire by Armenia attack.
"[Upper Karabakh] is under occupation. The Minsk trio has left the issue on the table for 25-30 years," he added.
OSCE Minsk Group -- co-chaired by France, Russia and the US -- was formed to find a peaceful solution to the conflict, but has yet to get any results.
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.
Twelve 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.
Speaking on the Libyan conflict, Erdogan said Turkey will continue to discharge its responsibility in Libya.
"We will not leave our Libyan brothers alone. Our relationship with Libya covers over a 500-year period," he added.
Since April 2019, Haftar's illegitimate forces have launched attacks on the Libyan capital of Tripoli and other parts of northwestern Libya, resulting in more than 1,000 deaths, including civilian women and children.
However, the Libyan government has recently achieved significant victories, pushing Haftar's forces out of Tripoli and the strategic city of Tarhuna.