Singapore initially merged with the Federation of Malaya in 1963 to form Malaysia in hopes of gaining independence. However, political and economic differences between Singapore and the ruling Alliance Party of Malaya led to tensions. Racial riots in 1964 further strained relations. Ultimately, disagreements could not be resolved, and Singapore separated from Malaysia in 1965, achieving full independence as a sovereign republic.