North Africa And Spain
The Umayyads ruled over two centuries until they weakened and were replaced by local rulers.
Meanwhile in North Africa, various local dynasties held sway until two powerful Berber dynasties succeeded in uniting much of North Africa and also Spain in the 12th and 13th centuries. After them this area was ruled once again by local dynasties such as the Sharifids of Morocco who still rule in that country.
As for Spain itself, Muslim power continued to wane until the last Muslim dynasty was defeated in Granada in 1492 thus bringing nearly eight hundred years of Muslim rule in Spain to an end.