Singapore gained independence through a merger with Malaya in 1963 to form Malaysia. However, tensions arose between the Alliance Party in Malaya and PAP in Singapore over political ideology, racial issues, and economic disagreements. Racial riots in 1964 exacerbated tensions. Ultimately, the Prime Ministers of both countries agreed in 1965 that separation was best, and Singapore peacefully gained full independence as a sovereign republic on 9 August 1965.