The area of Western Sahara is home to the Saharawi people who became Spanish subjects when Spain colonized the area in 1884. The United Nations (UN) became involved with Western Sahara when the UN asked Spain on December 16, 1965, through a General Assembly resolution, to decolonize the former Spanish territory. King Hassan II of Morocco rejected claims of independence for Western Sahara as early as 1975, despite International Court of Justice findings that Morocco did not have legal ties to the area. However, a Moroccan rule of the area can be traced to Islamic expansion in the area, starting with the Midrarid dynasty (823-977 AD). In October 1975, King Hassan ordered an invasion of Western Sahara, and the United States pressured Spain to withdraw.