Berber rebels in the Rif Region first established the Rif Republic (1921-1926) under Abd el-Krim against Spanish colonial rule, the state lasted until 1925 when the rebels tried to take the city of Fes, in a failed attempt to expand the republic into French Morocco.
Flag of the Republic of Morocco, used by republicanist activists
In 1971 army cadets under General Madbouh and Colonel Ababuh attacked king Hassan II in the Shkirat palace. A republic was proclaimed on Radio Rabat, was but suppressed by General Mohamed Oufkir. However, in 1972 Oufkir initiated his own coup d'état; the Air Force tried multiple times to bring down the king's airplane, attacked the Rabat airport and bombed the royal palace in Rabat. The coup ultimately failed.
During the 2011–12 Moroccan protests, a few protesters chanted republican slogans. They were mainly from the Al Adl Wa Al Ihssane Islamist movement and the Ila Al Amame Communist party. These slogans weren't repeated by the vast majority of the protesters.