MANILA (Reuters) - Philippine government negotiators and a Maoist rebel group have struck a deal for a temporary joint ceasefire and plans to free prisoners after days of talks in the Netherlands, an official and domestic broadcaster ANC said on Wednesday.

Communist New People’s Army rebels have been waging protracted guerrilla warfare for nearly five decades in rural areas in the poor Southeast Asian country, killing more than 40,000 people.

Peace talks between the rebels’ political arm, the National Democratic Front, and the government, brokered by Norway, resumed this week in the Netherlands, hoping to reach a political settlement in 12 months to end the conflict.

The two sides “after several days, have crafted together with the NDFP an agreement,” Jesus Dureza, a presidential adviser on the peace process, said on social media site Facebook.

President Rodrigo Duterte had approved the deal, he added.

It is the second time the two sides have agreed on a bilateral truce since November 1986, when the government and rebels signed a 60-day ceasefire.

But that deal was scuttled in January 1987 after police opened fire and killed 13 people during a farmers’ demonstration in Manila.

The two sides are still finalizing the terms of the ceasefire but would sign the agreement on Wednesday at around 9 p.m. in Manila, broadcaster ANC said from in a live report from the Netherlands.

ANC said the government also agreed to free 23 elderly and sickly political prisoners, while the rebels would release three soldiers and a police officer taken captive in three separate areas on the southern island of Mindanao.

The two sides are also discussing social and economic reform, but it was not known if the guerrillas had agreed to a demand by Duterte for the rebels to halt extortion and recruitment activities.

Peace talks between the two sides have been “intermittent and inconclusive” since 1986, bogging down in 2012 when the government refused to free political prisoners. They resumed in August 2016, when Duterte released 19 rebel leaders from jail.

But the president scrapped talks in February when rebels ambushed an army convoy, breaking a unilateral ceasefire that held for five months. He set four conditions before both sides returned to the negotiating table on Sunday.