The Khartoum-based government and the southern Sudan People 's Liberation Army signed the peace agreement in January 2005 , ending 21 years of civil war .