ImagSouth Africa's President Cyril Ramaphosa vowed to bring about "hope and renewal" as he was inaugurated at a stadium in the capital Pretoria.
The African National Congress (ANC) leader vowed to tackle corruption and rejuvenate the struggling economy.
He was elected earlier this month with a majority of 57.5%, the smallest since the party came to power 25 years ago.
Mr Ramaphosa initially took over from Jacob Zuma in 2018 after Mr Zuma was accused of corruption.
Mr Ramaphosa is the country's fifth democratically elected president since apartheid ended in 1994.
"This is a defining moment for a young nation like ours," the president said in his speech in front of 32,000 people at the rugby stadium in Pretoria.
"There shall no longer be any person in this land who will be unable to meet their basic needs," he promised.
Image copyrightEPAWomen waving the South African flag
Image captionCrowds waved the South African flag as President Ramaphosa was sworn in
Image copyrightREUTERSTwo large planes and a fleet of small ones flying over the stadium
Image captionA flypast over the stadium added to the ceremony
Heads of state from more than 40 countries attended the inauguration and Mr Ramaphosa thanked them for their "sacrifices and tireless contributions" for the "liberation of our land".

Image copyrightAFPTraditional dancers lining up to perform at the ceremony
Image captionTraditional dancers performed at the ceremony
Image copyrightREUTERSRamaphosa waving to crowds after taking oath of office
Image captionRamaphosa waving to crowds after taking oath of office
"Many South Africans still go to bed hungry, many succumb to diseases that can be treated, many live lives of intolerable deprivation," he acknowledged.
"Too many of our people do not work, especially the youth," he said speaking on the 27% of young people who are unemployed.
He said the challenges the country faced were "real" but "not insurmountable" and "can be solved".
Image copyrightREUTERSSoldiers paraded at the inauguration
Image captionSoldiers paraded at the inauguration
Mr Ramaphosa is expected to choose his cabinet within the next few days, a challenge in itself in a party with many factions.
"He will be judged on a very high bar and the next step is the cabinet," Daniel Silke, director of the Political Futures Consultancy, told Reuters.
"If it contains any semblance of the dead wood from the past he will be severely critiqued," he added.
Image copyrightREUTERSSouth Africans cheering and waving flags
Image captionThe mood was generally optimistic in the crowd, but the president is under pressure to make changes in South Africa
Image copyrightEPAPeople in the crowd wearing colourful clothes
Image captionANC supporters dressed up for the event
Mr Zuma did not make an appearance at the inauguration, having attended court in the city of Pietermaritzburg on Friday in relation to corruption charges.
He told supporters he did not have time as he was "fighting to stay out of jail".
Image copyrightREUTERSJacob Zuma singing on the mic
Image captionJacob Zuma sang with his supporters as he left court in the city of Pietermaritzburg on Friday