Tensions in the South Caucasus have been high for months around the breakaway enclave, recognised internationally as part of Azerbaijan.
Azerbaijan and Armenia last went to war three years ago.
Baku ordered "illegal Armenian military formations" to hand over arms and dissolve their "illegal regime".
Azerbaijan and Armenia first went to war in the early 1990s after the fall of the Soviet Union. Then in 2020 Azerbaijan recaptured areas in and around Nagorno-Karabakh before a truce was agreed and monitored by Russian peacekeepers.
Ethnic Armenians in Karabakh appealed on Tuesday for a ceasefire and for talks to start. But it was clear from the Azerbaijani ultimatum that Baku's aim was to complete its conquest of the mountainous enclave.
Armenian Prime Minister Nikol Pashinyan accused Azerbaijan of starting a ground operation aimed at "ethnic cleansing".
But hundreds of Armenian protesters, frustrated by their country's response, clashed with police outside parliament in Yerevan, condemning their leader as a traitor and calling on him to resign.
Azerbaijan said talks could start in the town of Yevlakh, some 100km (60km) north of the Karabakh regional capital of Khankendi, called Stepanakert by ethnic Armenians.
Buildings and vehicles were damaged by shelling in the Karabakh regional capital
Since the end of 2020, 3,000 Russians have monitored the fragile truce but Moscow's attention has been diverted by its full-scale invasion of Ukraine.
An estimated 120,000 ethnic Armenians live in the mountainous enclave. Russia said its soldiers had moved almost 500 civilians from the most at-risk areas, while separatists said they had helped move a total of 7,000.
For the past nine months, Azerbaijan has imposed an effective blockade on the only route into the enclave from Armenia, known as the Lachin Corridor.
Azerbaijan said it had launched its operation in response to the deaths of six people, including four police officers, in two landmine explosions on Tuesday morning.
Air raid sirens then rang out and the sound of artillery and gunfire could be heard in Karabakh's main city. Residential buildings were damaged and journalist Siranush Sargsyan described seeing a building next door being hit.
Karabakh officials said five people had been killed and dozens more wounded, including women and children.
Defence officials in the breakaway region said the Azerbaijani military had "violated the ceasefire along the entire line of contact with missile-artillery strikes". Other Karabakh representatives spoke of a "large-scale military offensive" although later reports said that the intensity of fire had decreased.
The Azerbaijan defence ministry insisted it was not targeting civilians or civilian buildings, and that "only legitimate military targets are being incapacitated by the use of high-precision weapons".
It accused Armenian forces of "systematic shelling" of its army positions and said it had responded by launching "local, anti-terrorist activities... to disarm and secure the withdrawal of formations of Armenia's armed forces from our territories".
Azerbaijani officials posted images of what they said was the aftermath of a deadly landmine blast
In a brief televised address, Armenia's prime minister rejected claims that his military was involved.
Russia's foreign ministry said it had been warned of the Azerbaijani offensive only minutes in advance and urged both countries to respect a ceasefire signed after the war in 2020. The EU's regional special representative, Toivo Klaar, said there was "urgent need for immediate ceasefire".
Both Russia's Foreign Ministry and the US Secretary of State, Antony Blinken, called for Mr Aliyev to cease military action in the area immediately.
South Caucasus commentator Laurence Broers said on Tuesday the Armenian population in Karabakh had been weakened by the blockade and the Azerbaijan operation had been launched "seemingly to retake Armenian-populated Karabakh in its entirety".
Nikol Pashinyan said recently that Russia was "spontaneously leaving the region". Azerbaijan has meanwhile had strong support from its ally Turkey.
Hikmet Hajiyev, special adviser to Azerbaijan's President Aliyev, called on the separatist ethnic-Armenian administration to "dissolve itself".
"Azerbaijan has always said we are ready to provide rights and security of Karabakh Armenians under the constitution," he told BBC News.
Azerbaijan had denied building up troop numbers in the region. On Monday, it allowed aid from the International Committee of the Red Cross into Karabakh on two roads, one via the Lachin Corridor from Armenia and the other on Azerbaijan's Aghdam road.
Before Tuesday's offensive began there had been hopes that tensions might subside.
The Azerbaijan defence ministry released images of a vehicle which it said were destroyed by a land mine, but ethnic Armenian officials said it was Azerbaijan's military that had violated the ceasefire.
Armenia-Azerbaijan: Nagorno-Karabakh map
By Paul Kirby