Residents have blamed traditional Dogon ethnic hunters for the attack, in which the UN says women and children also died, in a village of Fulani herders, in the latest violence between the two groups.
"We have come to tell you the Malian state is with you, we offer the condolences of the nation and assure you this crime will not go unpunished," Keita said during a visit to Koulogon village in central Mopti region.
Village representative Souleymane Diallo told AFP by telephone that Keita arrived by helicopter with government and army officials and visited the graves of the victims before handing donations to local residents.
"We don't want the army to leave the area because the bandits will come back and we are worried about our security," Diallo said.
Seven people were arrested a day after armed men attacked the village.
Mali army forces were sent to the scene after the massacre and also went into Bobosso village, near the Burkina Faso border, following arson attacks, killing one suspect and detaining 24 others.
The violence is fuelled by accusations of Fulani grazing cattle on Dogon land and disputes over access to land and water, but the area is also troubled by jihadist influence.
The UN says more than 500 people were killed in violence in the area in 2018.
France helped Malian forces curb a jihadist insurgency that took over large parts of the northern Mali in 2012, but since the death last November of Fulani jihadist leader Amadou Koufa, inter-communal violence has increased.
A UN mission was expected to arrive at the village soon as part of an investigation, and France also said it was concerned over the increase in deadly inter-communal violence.
"I strongly condemn these attacks against civilians in the village of Koulogon Peul and call for the perpetrators to be held accountable," said Joanne Adamson, Deputy Special Representative for the UN Mali mission, known as MINUSMA.
"We need to intensify our efforts to find judicial and political solutions."
MINUSMA said in its statement that the attack would be investigated with the help of UN human rights experts.
Mali's Prime Minister Soumeylou Boubeye at the end of last year announced an extension of a programme of disarmament of militias and former jihadists as a way to consolidate peace in the troubled north.