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