The latest crime statistics show that the situation in South Africa is "quite bad", President Cyril Ramaphosa said in Johannesburg on Sunday.
"We cannot be a lawless country. We cannot be a country where lawlessness just happens, just willy nilly, where anybody just does what they like," he said.
He was speaking in his capacity as African National Congress president in an address to the party's Johannesburg branches.
"And we are now saying, we have got to draw a line. The law of the Republic of South Africa must be observed and must be obeyed by all who live in this country."
He called for "determined action" to deal with criminality.
"We saw, with the crime statistics that came out, that the situation in our country is actually quite bad."
He said leadership was needed in policing forums and other structures to make sure that, even when there were service delivery protests, they do not end in mayhem, destruction of property and loss of life.
His comments came after the release of the annual crime statistics which revealed 21 022 murders in the 2018/19 financial year - 686 more than the previous year, and an increase of 3.4%.
Sexual offences increased by 4.6% to 52 420 offences – 2 312 more than the year before.
Ramaphosa called on delegates to come up with a campaign to prevent gender-based violence, and asked them to make foreign nationals feel that they were safe in South Africa.
He is scheduled to address a joint sitting of Parliament on Wednesday on gender-based violence.
Ramaphosa called on delegates to protect women and take up the cases of women who were raped, to help them see the matter through to prosecution.
"We must be the ones who police society on these matters," he implored.
After being booed in Harare at former Zimababwean president Robert Mugabe's funeral on Saturday, Ramaphosa called for peace regarding accusations of xenophobia by South Africans towards foreign nationals.
"The strangest thing is that it is against our fellow Africans," he said.
He said he understood the struggle for jobs, and service delivery problems, but insisted that South Africans were not xenophobic.