The two sides have promised the United Nations Security Council they will sign an agreement by December 31st to formally end 21 years of civil war .