The first flag of the California Republic was formed in 1846, following the rebellion of a group of illegal American immigrants against the Mexican government. After learning of the state of the Mexican-American War, these settlers formed an alliance to help aid the U.S. military. Indigenous people additionally aided American forces as scouts, translators, and wranglers, despite the fact that the U.S. Army Forces had murdered many natives in attacks prior. Following this, Mexican rule collapsed in 1847, and upon learning that slave-traders had been appointed positions of power as Indian sub-agents, natives continued their interior stock-raiding attacks. As a result, the nearby governments placed restrictions that required natives to carry employment certificates.