South Sudan's president said Monday he had defeated a coup attempt by a political rival following a night of fighting in the capital Juba.