Aliyev, speaking during a meeting with Turkish Foreign Minister Mevlut Cavusoglu in the Azeri capital Baku, also said Armenia had "no basis" to request Russian military assistance in the conflict.
Further shelling was reported by Azerbaijan and ethnic Armenian forces in and around Nagorno-Karabakh on Sunday. The death toll in the region's worst fighting in more than 25 years has already surpassed 1,000 and is possibly much higher.
Nagorno-Karabakh is internationally recognized as part of Azerbaijan but is populated and controlled by ethnic Armenians.
The conflict has brought into sharp focus the increased influence of Turkey, an ally of Azerbaijan, in a former Soviet region considered by Russia to be within its sphere of influence. Russia also has a security alliance with Armenia.
Armenian Prime Minister Nikol Pashinyan has asked Russia to outline the extent of the support it could expect from Moscow.
In response, Russia's foreign ministry said on Saturday it would provide "all assistance required" should the conflict spill onto "the territory of Armenia" - land that is outside the current conflict zone.
Aliyev, quoted by state news agency Azertag, said he wanted to resolve the conflict through negotiations that would result in the withdrawal of ethnic Armenian forces.
"Otherwise," he said, "we will continue by any means to restore our territorial integrity and ... we will go to the end."
Azerbaijan's advances on the battlefield since fighting began on Sept. 27 have reduced its incentive to strike a lasting peace deal and complicated international efforts to broker a truce. Three ceasefires have failed to hold.
The ethnic Armenian-controlled Nagorno-Karabakh military said that missiles been targeted at the town of Martuni, the village of Karin Tak and the city of Shushi, just 15 kilometers (9 miles) from the enclave's largest city, Stepanakert.
Armenia's defense ministry said a second militant from Syria had been captured on the battlefield. Azerbaijan has previously denied the presence of foreign fighters.
Azerbaijan's defense ministry said its army units in Tovuz, Gadabay and Gubadli had come under shelling overnight. Combat on Sunday was concentrated in Aghdere, Aghdam, Gubadli and Khojavend - the Azeri name for Martuni.
Nagorno-Karabakh's army says 1,166 of its soldiers have been killed since Sept. 27 and the office of Nagorno-Karabakh's human rights ombudsman said the civilian death toll was 45.
Azerbaijan, which does not disclose its military casualties, says 91 civilians have been killed. Russia has estimated as many as 5,000 deaths on both sides.