JUBA (Reuters) - South Sudan’s parliament voted on Thursday to extend President Salva Kiir’s mandate until 2021 in a move likely to undermine peace talks as opposition groups have said the change would be illegal.

The vote will bolster the government team at peace talks with rebel groups in Khartoum, Sudan, said Paul Youani Bonju, chairman of parliament’s information committee. The extension also applies to vice presidents, state lawmakers and governors.

South Sudan gained independence in 2011 but erupted into violence in late 2013 over a political disagreement between Kiir and his former vice president Riek Machar.

“We regret the move as it shows the regime is playing games at the negotiating table. The international community should not recognize this move and the regime should be declared as a rogue regime,” Mabior Garang de Mabior, spokesman of Machar’s rebel group, the SPLM- IO, told Reuters by phone from Nairobi.

The law change will extend the presidential and other officials’ terms until July 12, 2021.

This week, Machar’s rebel group rejected plans to reinstate Machar as vice president, saying it had failed to dilute Kiir’s power.

Rebels rejected parts of a peace deal signed in June. Previous agreements have promptly been broken.

Lam Paul Gabriel, deputy military spokesman for Machar’s SPLA-IO, said government troops attacked its positions on Thursday in Kajo Keji in the country’s northwest in fighting that killed five government soldiers and one rebel.

Government military spokesman Lul Ruai Koang said rebels ambushed and killed three of its soldiers who had gone to look for wild cassava on Tuesday.

The civil war has killed tens of thousands of people and forced millions to flee from their homes.

It has also cut South Sudan’s crude oil production, which the government depends on for revenue, with output at less than half its pre-war level of 245,000 barrels per day.