The Keita dynasty ruled Mali , pre-imperial and imperial , from the 12th to the early 17th century .
The Keita dynasty ruled pre-imperial and imperial Mali from the 12th century into the early 17th century .