Two homesteads on the same street in the town of Lusikisiki, in the Eastern Cape, were targeted, police said, with 12 women and one man killed in one location, and three women and one man at a second location.
The 18th victim died in hospital on Sunday, the South Africa Police Service said.
Police Minister Senzo Mchunu said the motive for the shootings was unknown.
In a statement on Sunday, police said that apart from the death of the 18th person, there were no other new developments. No arrests have been made so far.
Officials said the victims were relatives and neighbours in Nyathi village, Ngobozana in Lusikisiki.
South African media reported the victims had been gathered at the houses to prepare to attend a traditional mourning ceremony for a mother and daughter who were murdered a year ago.
They had been packing goods and presents, including furniture, for the event when the attack occurred on Friday night, according to the media reports.
“We heard gunshots and doors that were kicked,” Nomnikelo Ndlovu, one of the residents who was able to hide during the attack, told state broadcaster SABC.
“We tried to hide and three people were shot. We are still traumatised.”
In a statement on Saturday, the police minister said that there had been a total of 19 people sleeping in two homes in the same yard at one of the shooting locations.
Mchunu added that there had been six survivors at that homestead – four women, a man, and a two-month-old child. A police spokesperson said earlier that the child was uninjured, but had been taken to hospital as a precaution.
There were no survivors at the other homestead.
Mchunu said a team of detectives and forensic experts, including crime scene managers from Pretoria, had been deployed “to piece all [the] evidence together in a bid to apprehend these brutal criminals”.
Regional cabinet member for community safety Xolile Nqatha told SABC that he hoped the critically injured man would make a “speedy” recovery, as “his recovery can help us shed more light” on the shooting.
He also suggested that the assailants may have been known to the victims.
South Africa has one of the highest murder rates in the world, according to the latest figures from the United Nations Office on Drugs and Crime.
There were more than 27,000 murders in 2022 – amounting to 45 people per 100,000, out of a population of almost 60 million. By comparison, the US rate is six per 100,000.