The African National Congress (ANC), which lost its 30-year-old parliamentary majority in last month's vote, must now share power for the first time since the end of white minority rule if it wants to continue governing South Africa.
Having opted for a government of national unity over a traditional coalition formation, the party is racing to cobble together a patchwork bloc made up of its erstwhile rivals.
Here is a timeline of what to expect next:
What is happening now?
The ANC has until the first session of the new parliament, scheduled for Friday, June 14, to forge its new political alliances before lawmakers sit to choose a president, who is expected to be from the ANC as the largest party.
Given its poor election performance, the ANC will need to bring in at least one large rival among its prospective partners.
It is talking to parties spanning the political landscape, from the free-market Democratic Alliance (DA) to the Marxist Economic Freedom Fighters (EFF). But major ideological differences and, in some cases, long-standing animosity are complicating matters.
The DA, the largest opposition party, has said it won't join a formation with the EFF, or former President Jacob Zuma's uMkhonto we Sizwe (MK) party, which came in a surprising third in last month's vote.
The EFF has said it will not enter a government that includes the DA or the Freedom Front Plus, two parties that draw support from among South Africa's white minority.
MK, in turn, has said it will not partner with the ANC if it is headed by President Cyril Ramaphosa, a rival of Zuma's who replaced him in 2018. The ANC says Ramaphosa's position is non-negotiable.
Parliament convenes
The 400-seat National Assembly will hold its first session on Friday, where lawmakers will swear the oath of office before electing their speaker, deputy speaker, and the country's president.
Since the ANC fell short of a majority, having won 159 seats, it will need to draw upon the support of its new political allies to retain the presidency.
Under South African law, candidates for president are nominated by members of parliament. If only one candidate is nominated, he or she is then elected. However, in the case of multiple candidates, lawmakers cast secret ballots, with a candidate requiring support from a majority of members to be declared president.
Zuma's MK party has applied to the country's top court to block parliament from sitting. Despite outperforming expectations and winning 55 seats, MK claims fraud marred the polls, which observers and the electoral commission said were free and fair.
Inauguration of the president
Following the first session of the National Assembly, usually within days, the newly elected president is sworn in at an inauguration ceremony. He or she will preside over the seventh administration since the end of apartheid and the advent of multi-racial democracy.
Cabinet selection
The negotiations to form the government of national unity will determine the composition of the executive branch, which is expected to undergo a major overhaul.
Political parties will negotiate conditions, including preferred portfolios, positions, and cabinet candidates, which the newly elected president will announce in the days following his or her inauguration.
Key ministries such as finance, energy, foreign affairs, and public enterprises are among the most coveted portfolios.
Prior to the election, Public Enterprises Minister Pravin Gordhan, Minister in the Presidency Nkosazana Dlamini-Zuma, and Trade, Industry, and Competition Minister Ebrahim Patel all indicated they planned to step down.
South African law dictates that the president, who has the sole discretion to appoint the cabinet and deputy president, may select no more than two people from outside the National Assembly.
Once the cabinet is announced, the president, in conjunction with the speaker of the National Assembly and the chairperson of the National Council of Provinces, determines a date for the Opening of Parliament Address.
This address outlines the new administration's governing priorities and marks the beginning of the new five-year parliamentary term.
➤ Click here to follow our WhatsApp channel for more stories.