World powers want to prevent a wider war that might draw in Turkey, which has voiced strong support for Azerbaijan, and Russia, which has a defence pact with Armenia. The conflict has also strained relations between Ankara and its NATO allies.
The latest ceasefire was agreed on Sunday after separate talks in Washington between US secretary of state Mike Pompeo and the foreign ministers of Armenia and Azerbaijan.
Representatives of the OSCE Minsk Group, formed to mediate the conflict and led by France, Russia and the United States, also participated in the talks. The group said its co-chairs and the foreign ministers agreed to meet again in Geneva on 29 October.
Commenting on the talks, US president Donald Trump wrote on Twitter: "Congratulations to Armenian Prime Minister Nikol Pashinyan and Azerbaijani President Ilham Aliyev, who just agreed to adhere to a cease fire effective at midnight. Many lives will be saved."
Nagorno-Karabakh has said that 974 of its military personnel have been killed since 27 September. Azerbaijan says 65 Azeri civilians have been killed but has not disclosed its military casualties.
Russian president Vladimir Putin said last week that 5,000 people might have been killed in the fighting.
Pashinyan, the Armenian prime minister, wrote on his Facebook page that the Armenian side "continued to adhere to the ceasefire."
About 30,000 people were killed in a 1991-94 war over Nagorno-Karabakh. Armenians regard the enclave as part of their historic homeland; Azeris consider it illegally occupied land that must be returned to their control.