Ramaphosa was "duly elected president of the Republic of South Africa," chief justice Mogoeng Mogoeng told parliament after Ramaphosa was the only name nominated by lawmakers in Cape Town.
MPs from the African National Congress, which won 230 out of 400 seats on May 8, choose the head of state in the parliament's first post-election sitting.
The ANC won the ballot with 57.5% of the vote, its thinnest majority since the end of apartheid.
Ramaphosa will be sworn in on Saturday, May 25, and is expected to name a deputy president and cabinet at the weekend.
Under South Africa's 1996 constitution, electors vote for a party, and the party selects individuals who go to the National Assembly, which then chooses the head of state.
Ramaphosa, 66, is a trade unionist who played a prominent part in the struggle against white minority rule before becoming a successful businessman after the end of apartheid.
He will serve his first full five-year term since taking over last year from Jacob Zuma who was forced out over a series of corruption scandals.
Ramaphosa's first test as he starts his new term will be his choice of a cabinet – a task beset by rival factions within the ANC.
Shadow of scandals
Prospects of a major reshuffle were heightened when Deputy President David Mabuza announced he would defer taking his oath as a lawmaker.
An ANC integrity commission report has alleged Mabuza – the party's No. 2 – "prejudiced the integrity of the ANC and brought the organization into disrepute."
Seen as a pro-Zuma figure, his name has repeatedly come up in media reports into corruption and political killings when he was premier of the eastern Mpumalanga province.
He later became the ANC's vice president in December 2017 when Ramaphosa was elected party leader.
"Ramaphosa will never be more powerful than he is right now," political analyst Richard Calland told Agence France-Presse.
"He has to impose his authority. He can't dispense all of the Zuma faction...but he has to take them out of key positions so that he can govern decisively."
Another senior ANC official, outgoing environment minister Nomvula Mokonyane, who has been named in the ongoing judicial inquiry into state corruption, has also pulled out of the swearing-in and will not be an MP.
The main opposition Democratic Alliance's chief whip in parliament, John Steenhuisen, said the last-minute withdrawal by two senior ANC members was "very clearly a sign that something is afoot in the ANC."
"It is completely bizarre...the divisions that exist within the governing party are continuing to exist and we are seeing manifestations of the various factions now playing out," said Steenhuisen. – Rappler.com