The president, currently on a state visit to Angola, tweeted in consolation "To their mothers and their families, I express my deepest sympathy,"
Senegal's health minister, Abdoulaye Diouf Sarr, who is in Geneva for the World Health Assembly, said he would cut short the trip and return to Senegal immediately.
Sarr said on private Senegalese television TFM that "according to preliminary investigation, a short circuit triggered the fire".
Demba Diop Sy, the mayor of Tivaouane, one of Senegal's holy cities and a transport hub, said police and fire service investigators remained on the scene after the blaze, but did not provide further details.