Nigerian President Muhammadu Buhari has met his South African counterpart Cyril Ramaphosa, weeks after xenophobic attacks in Johannesburg triggered tensions between Africa's leading economies.
Nigerians were among those targeted during the wave of violence which resulted in the death of 12 people and led to an extraordinary airlift of hundreds of people last month.
On Thursday, amid warm smiles and a joint commitment to strengthen bilateral relations, Buhari said the attacks were "unacceptable" and called for preventive measures.
"We call for the strengthening and implementation of all the necessary measures to prevent the reoccurrence of such actions," he said.
Ramaphosa condemned the violence, saying: "Early warning mechanisms will be set up so that when we see there is restiveness in both of our people ... we will be able to inform one another."
He added: "We are equally committed to upholding the rule of law and ensuring that all those involved in criminal activities, regardless of their nationality, are prosecuted."
It is Buhari's first visit to South Africa since Ramaphosa's new administration was established earlier this year. The three-day visit is also the first to the country by a Nigerian leader since 2013.
Buhari and his ministers were welcomed with cannon shots and a guard of honour under a bright spring sun. At the welcome ceremony in Pretoria's Union Buildings, Ramaphosa and Buhari referred to each other as "brothers".
Buhari and Ramaphosa, accompanied by key ministers, discussed various issues, including strengthening economic relations.
The Nigerian leader's visit marks the 20th anniversary of a Bi-National Commission (BNC) established between the two countries in 1999. Since then, dozens of trade agreements have been signed between them.
In 2018, the total value of trade between them amounted to $3.35bn, making Nigeria South Africa's largest trade partner in West Africa.
A joint business forum between South Africa and Nigeria was held on Thursday afternoon.
"We want to create an enabling environment for doing business in our respective countries," said Ramaphosa, pointing out road, mining and infrastructure as key areas.
The South African leader also acknowledged Nigeria's support in the struggle against apartheid.
Buhari said his government is committed to fighting unemployment and poverty in his country. He also promised more opportunities for investors in Nigeria.
Formal relations between the two countries were established after the first democratic elections in South Africa in 1994.
Related stories: South Africa President to host Nigeria President after xenophobic violence
Video - Nigerians repatriated from South Africa after attacks