The Prophet (sallallahu alaihi wa sallam) gave flags to the Muslim army. The flag-bearer defended it with his life like in the Battle of Muta. There was no fixed pattern or colour although the major flag was said to be pure black. There were also white, yellow and red flags.
The Ummayads used a white flag, the Abbasids black, the Fatimids green. The Ottoman Turks introduced flags with crescents in 1299. In 1453 it became a symbol of Islam. The state flag was red with a white crescent while the religious flag was green with a crescent. In 1793 a star was added, and made 5-pointed in 1844 to symbolize the 5 pillars of Islam. Many Muslim countries use the star and crescent on their flags like Algeria, Comoros, Malaysia, Pakistan, Turkey and Uzbekistan.