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