Entering a new era of unpredictable politics, South Africa’s newly elected Parliament convened for the first time on Friday as lawmakers prepared to elect the country’s next president after national elections last month.

The long-governing African National Congress, which failed to secure an absolute majority for the first time since it came to power after the end of apartheid, formed a delicate alliance with rival parties, clearing the way for Cyril Ramaphosa to be elected president for a second term.

But the two weeks after the election have been marked by turbulent negotiations between the A.N.C., which Mr. Ramaphosa leads, and rival political parties.

The process has exposed deep fissures within the A.N.C. and in the broader society, and in a telling development, Parliament opened without any kind of formal announcement about a coalition agreement.

The president’s party had governed with comfortable majorities since the end of apartheid in 1994. But its popularity has plummeted and it captured only 40 percent of the vote in the most recent election, reflecting the broad discontent of a continental powerhouse struggling with economic stagnation, high unemployment and entrenched poverty.

Having lost its dominance in Parliament, the A.N.C. engaged the broad spectrum of parties that won seats in the National Assembly, seeking to create what it called a government of national unity that would give all of them a role in governing.