Turkish President Recep Tayyip Erdogan and his Azerbaijani counterpart Ilham Aliyev signed the deal during a visit to the city of Shusha recaptured by Azerbaijan during last year's war with Armenia in the Nagorno-Karabakh region.
"With the Shusha Protocol, we have determined the road map for our relations in the new term," Erdogan said, adding that it aims to increase bilateral political and military cooperation.
"In case of a threat or attack on the independence or territorial integrity of any of the parties by a third state, the parties will provide the necessary assistance to each other," said the protocol.
The protocol envisages the opening of the Zangezur corridor from the Nagorno-Karabakh region to a railway line through Nakhchivan and Turkey's eastern Kars province.
Turkey will open a general consulate in Shusha to support Azerbaijan for rebuilding the Nagorno-Karabakh region, Erdogan was quoted as saying.