The Muslims conquered Jerusalem in 638 and ruled it until 1099 when the Crusaders conquered it.
The Crusaders killed or expelled Jews and Muslims from the city.
The Muslims under Saladin took it back in 1187 CE and allowed Jews to return, and Muslims ruled it until the end of World War I, or altogether for about 1192 years.