LONDON — South Africa’s new president, Cyril Ramaphosa, who had traveled to London this week to assure global investors of his determination to tackle corruption in his country and restore faith in its public institutions, cut short his trip on Thursday to deal with unrest at home — a vivid indication of the challenges he faces.

The protests in the North West Province, in which demonstrators seeking better jobs and housing, and improved roads and hospitals, clashed with the police, were the biggest in the two months since Mr. Ramaphosa took office.

His predecessor, Jacob Zuma, was tarnished by scandal and deeply unpopular during much of his nearly nine-year tenure, and he was eventually forced out in a struggle within the leadership of the African National Congress, the party that has governed South Africa since the end of apartheid in 1994.

In a statement announcing his return from London to Pretoria, one of South Africa’s capitals, Mr. Ramaphosa’s office said he had “called for calm and adherence to the rule of law” in the province, and urged demonstrators “to express their grievances through peaceful means and engagement rather than violence and anarchy.”