(CNN) Libya's renegade Gen. Khalifa Haftar has declared a ceasefire, ending a nine-month campaign to seize the capital, Tripoli.

The conditional ceasefire in the western region of the country -- including Tripoli -- started at 12:01 a.m. local time Sunday, according to the general's spokesman, Ahmed al-Mismari.

That's provided that the rival side -- the UN-recognized Government of National Accord (GNA) -- abides by it, the statement added.

"The response will be harsh to any breach of this armistice," said al-Mismari.

The GNA said the ceasefire was violated just minutes after going into effect by militias in Salah al-Din and Wadi al-Rabi districts. Despite this, the GNA is still committed to the ceasefire but said if it occurs again the "response will be violent and harsh."

Read More