Lawmakers in South Sudan on Tuesday voted to extend the tenure of President Salva Kiir by three years, a move the government had was necessary for stability amid an ongoing rebellion led by a former deputy president.

The proposal to extend Kiir's term, which was set to expire in July, was endorsed in February by Kiir's Cabinet before being forwarded to parliament for approval.

Lawmaker Thomas Kundu, who heads parliament's information committee, told The Associated Press that the measure, passed by more than two-thirds of the legislators on Tuesday, also extends the tenure of the legislature.

He said the measure was necessary for peace and stability amid a violent rebellion led by Kiir's former deputy, Riek Machar.

Peace talks between Kiir and Machar have repeatedly failed.

"As you know peace is a process and it includes signing a peace (agreement), reconciliation, healing. So we believe these three years will give a chance for peace so that all of us prepare to conduct a census and after which we can conduct free and fair elections," Kundu said.

South Sudan has seen sporadic fighting since December 2013 as government forces loyal to Kiir, a member of the dominant Dinka ethnic group, try to put down rebels led by Machar, who is of Nuer ethnicity. The fighting has often been along ethnic lines.

Machar had been Kiir's deputy until July 2013 when he was fired amid a power struggle in the country's ruling party.

It is widely believed that the political rivalry between Kiir and Machar fueled the current conflict in South Sudan — the reason many international observers and diplomats say a political solution is needed to bring peace to the country.