As tensions with Japan arose in the 1930s the British set up a naval base in Singapore, one of the world's largest naval bases. However, when World War II broke out, the British were pre-occupied in Europe and in 1942 the Japanese easily overran the Malay Peninsula, leading to the surrender of Singapore. Under Japanese rule the people were treated harshly, especially the ethnic Chinese, who made up the island's majority and who the Japanese disliked in general.
After the war, the British surrender hurt their image in the eyes of the locals and soon people started thinking about independence. By the late 1950s the island was given domestic self-rule and in 1963 Singapore joined the Federation of Malaysia along with what is today Malaysia and Brunei.
The union with Malaysia was short lived though as the Chinese in Singapore disagreed with numerous policies of the Malaysian government, most significantly giving special rights and privileges to ethnic Malays. This led to protests and Indonesian intervention, who fought the new Malaysia as he sought lands in northern Borneo.
As the violence escalated on all sides, Malaysia expelled Singapore from the federation in 1965 without letting the British know until after the vote. That same day the Parliament in Singapore passed an act to become an independent republic.
Singapore was immediately faced with a growing communist movement, unemployment, and numerous other issues. This was countered by making the country an oil refinery center and by making English the de facto language to improve international trade and economic opportunities.
In the 1980s and 1990s Singapore has gotten more involved in the high tech industries and trading; they also began pushing tourism as housing and infrastructure was heavily developed.
In the 2000s the country has had a couple setbacks. There were some terrorist threats by Islamic extremists and the financial crisis in Asia slowed the economy. There was also an outbreak of SARS, which led to panic. The economy is again on the right path though as legalized gambling has led to a large income source.