CAPE TOWN (Reuters) - South African President Cyril Ramaphosa has been re-elected for a second term, having won a majority of votes in the National Assembly, the chief justice said on Friday.

Ramaphosa got 283 votes versus 44 for Julius Malema, the leader of the opposition Economic Freedom Fighters party.

Earlier in the day the Democratic Alliance party said it would vote for Ramaphosa as part of an agreement with the African National Congress to form a unity government.

(Reporting by Wendell Roelf; Writing by Nellie Peyton and Bhargav Acharya; Editing by Alexander Winning)