A rebellion in nearby Herzegovina (1875-1878) sparked a series of rebellions and uprisings against the Ottoman forces in Europe. Montenegro and Serbia agreed to declare a war on Turkey on 18 June 1876. Nichola I's cousin had twice routed the Ottomans at Medun. A Montenegrin victory in Danilograd in Zeta, and the capitulation of Medun, concluded the first year of the Montenegrin–Ottoman War (1876–1878). In 1877/1878, Nicholas I of Montenegro acquired a seaboard on the Adriatic, and on 13 January 1878 Nicholas I and Ahmed Muhtar Pasha signed a truce, ending the war.