Libyan strongman Khalifa Haftar salutes during a military parade in 2018.
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.”

Since April, forces loyal to Haftar have been waging a campaign against the GNA to take Tripoli.

Eight years after the fall of strongman leader Moammar Gadhafi, the North African country is mired in violence and split into rival administrations. Haftar’s, in eastern Libya, is often at odds with the Western-backed government based in Tripoli.

Also in the mix are multiple tribes competing for control of Libya’s dwindling oil wealth, as well as militant groups, including ISIS, scattered across the vast country.

Sunday’s truce follows calls last week from Russia and Turkey – which back rival sides in Libya’s civil war – for a ceasefire in the conflict.

Hours after General Haftar’s ceasefire statement, the GNA also agreed to the truce, laying out a series of conditions for both sides to follow.

It said each side needs to send a military committee to work on a needed arrangement toward a “ceasefire under the supervision of the United Nations.”

The GNA added it also has the right to defend itself in the event of “any attack or aggression that may occur from the other party.”

The United Nations Mission in Libya (UNSMIL) expressed it full readiness to support the Libyans and “use all its capabilities to assist them in in a peaceful and final solution in the Libyan crisis” in a statement posted on its official account Twitter on Saturday.

Russia and Turkey weigh in

While Russian mercenaries support Haftar, Turkey backs the Tripoli-based GNA.

On Wednesday, Russian President Vladimir Putin and Turkish President Recep Tayyip Erdoğan met in Istanbul to discuss bilateral cooperation regarding the situation in Libya, Russian state-run news media RIA Novosti reported.

That meeting came after the Turkish Parliament passed a bill January 2 authorizing troops to be deployed to Libya, to help the GNA push back against Haftar’s offensive.

Along with support from Russia, Haftar is also receiving assistance from the United Arab Emirates and Egypt.

The GNA also has accused France of supporting the renegade general after French-purchased missiles were found in a base used by Haftar’s forces. France admitted the missiles belonged to them but denied supplying the weapons to Haftar.

At least 1,000 people were killed in and around Tripoli between April and July, according to the World Health Organization, in the attempt by Haftar’s self-styled Libyan National Army (LNA) and other militias to take over the capital.

CNN’s Sheena McKenzie and Nourhan Mustafa contributed to this report