Section 377A of the Penal Code was introduced under British colonial rule in the 1930s. British rule over the island ended in 1963 when Singapore became a state of Malaysia. It became independent two years later but retained the Penal Code, which made sex between men punishable by up to two years in jail.