South Africa will replace Libya as hosts of the 2013 CAF Africa Cup of Nations, CAF said in a statement on Tuesday.
Libya, where fighting continues for control of several cites, take over the 2017 tournament from original hosts South Africa.
The swap deal was agreed after the first half of a two-day CAF executive committee meeting.
"The Executive Committee also decided on the swapping between Libya and South Africa for the 2013 and 2017 respectively, considering the current political situation prevailing in Libya. This means that South Africa will host 2013 Africa Cup of Nations and Libya, 2017 Africa Cup of Nations," a CAF statement read.
The decision means South Africa will stand in for Libya a second time having held the African Youth Championship last April.
CAF has also awarded Namibia the 2014 African Women's Championship, Senegal the 2015 African Youth Championship, Niger the 2015 African Junior Championship and Madagascar the 2017 African Junior Championship.