A cease-fire agreement with Azerbaijan was reached on Wednesday to end two days of fighting in the separatist Nagorno-Karabakh region, local authorities and Azerbaijani officials said.