Cyril Ramaphosa was re-elected in the May 29 general election
Cyril Ramaphosa was re-elected in the May 29 general election AFP

South Africa's Cyril Ramaphosa hailed "the beginning of a new era" on Wednesday as he was sworn in for a second full term as president after his weakened African National Congress (ANC) struck a hard-won government coalition deal to remain in power.

Lawmakers voted overwhelmingly to re-elect the 71-year-old last week after a May 29 general election produced no outright winner for the first time in three decades.

"The formation of a government of national unity is a moment of profound significance. It is the beginning of a new era," Ramaphosa said, after taking the oath of office during a ceremony at the Union Buildings, the seat of government, in Pretoria.

"The voters of South Africa did not give any single party the full mandate to govern our country alone," he added, speaking before lawmakers, foreign dignitaries, religious and traditional leaders and cheering supporters.

"They have directed us to work together to address their plight and realise their aspirations."

Ramaphosa is expected to announce his cabinet in the coming days, as talks with coalition members continue.

Numerous heads of state, including Nigerian President Bola Ahmed Tinubu, Angola's Joao Lourenco, Congo Brazzaville's Denis Sassou Nguesso and Eswatini's absolute leader King Mswati III attended the inauguration.

Guests in suits, fancy dresses and coats to keep warm in the chilly winter weather started to arrive early in the morning amid a heavy police presence.

VIPs, some singing anti-apartheid struggle songs, were allowed into a small amphitheatre within the imposing, sandstone government building.

Other attendees, some holding South African flags, sat on a lawn outside as dancers and musicians performed on a big stage.

After Ramaphosa was sworn in, a band played the national anthem, followed by a 21-gun salute and a fly past by the air force.

It was the third time Ramaphosa has taken the oath.

The former trade unionist turned millionaire businessman first came to power in 2018, after his predecessor and rival Jacob Zuma was forced out before the end of his term under the cloud of corruption allegations.

Ramaphosa was then re-appointed for a full five-year term in 2019. In South Africa, voters elect the parliament, which then votes for the president.

Ramaphosa promised a new dawn for South Africa, launched an anti-graft drive and started to reform a collapsing energy system.

But under his watch, the economy languished, blighted by power cuts, crime remained rife and unemployment increased to 32.9 percent.

In May, he led the ANC into yet another vote, but the historied party of the late Nelson Mandela came out bruised.

It won only 40 percent -- down from 57.5 percent five years earlier.

For the first time since the advent of democracy in 1994, it lost its absolute majority in parliament and was left scrambling to find coalition partners to remain in power.

It has since agreed to form what it calls a national unity government with several other parties.

The deal allowed Ramaphosa to comfortably see off a last-minute challenge by firebrand leftist politician Julius Malema, with 283 lawmakers in the 400-seat National Assembly voting to put him back in office.

But it has faced a vociferous opposition from the left, with Malema's Economic Freedom Fighters and former president Zuma's uMkhonto weSizwe (MK) refusing to take part and denouncing the inclusion of right-wing parties and the white-led, free-market DA.

MK came third in the election but has contested the results.

Party spokesman Nhlamulo Ndhlela said in a statement ahead of the ceremony that its lawmakers would snub the "farcical inauguration of Cyril Ramaphosa as the puppet DA-sponsored President", also using a racial slur to describe the ANC leader.

But Ramaphosa said voters had stressed they were "impatient with political bickering" and wanted parties to "put their needs and aspirations first" and "work together for the sake" of the country.

"As leaders, as political parties, we are called upon to work in partnership towards a growing economy, better jobs, safer communities and a government that works for its people."

Ramaphosa's weakened African National Congress party struck a government coalition deal after failing to win an outright parliamentary majority in last month's elections
Ramaphosa's weakened African National Congress party struck a government coalition deal after failing to win an outright parliamentary majority in last month's elections AFP
A fly past by the air force and 21-gun salute followed Ramaphosa's swearing in
A fly past by the air force and 21-gun salute followed Ramaphosa's swearing in AFP