Immorality Act was the title of two acts of the Parliament of South Africa which prohibited, amongst other things, sexual relations between white people and people of other races. The first Immorality Act, of 1927, prohibited sex between whites and blacks, until amended in 1950 to prohibit sex between whites and all non-whites. The second Immorality Act, of 1957, continued this prohibition and also dealt with many other sex offences. The ban on interracial sex was lifted in 1985, but certain sections of the 1957 act dealing with prostitution remain in force as the "Sexual Offences Act, 1957".
The Immorality Act, 1927 (Act No. 5 of 1927) prohibited sexual intercourse outside of marriage between "Europeans" (white people) and "natives" (black people). The penalty was up to five years imprisonment for the man and four years imprisonment for the woman. A person's color during trial was dictated by their 'race', a term which at the time described a person's appearance, mannerisms, and assumed descent/ethnicity (similar to later 'color classifications' recognized during the Apartheid era of South African history, where races were decided upon by government officials, not pre-determined by the true ethnicity of the accused). The act also prohibited "procuring" women for interracial intercourse, and contained a proposal that described a punishment of up to six years of imprisonment specifically for colored women who were thought to be provoking white males to have intercourse with them.
The Immorality Amendment Act, 1950 (Act No. 21 of 1950) amended the 1927 act to forbid unmarried sexual intercourse between "Europeans" and anyone not "European". The prohibition was therefore extended to intercourse between white people and coloured or Asian people. Interracial marriages had been banned in 1949 by the Prohibition of Mixed Marriages Act. Later legislation closely related to the Immorality Act also banned the marriage of interracial couples outside of South Africa, viewing foreign marriages as invalid and illegal.
The Immorality Act, 1957 (Act No. 23 of 1957; subsequently renamed the Sexual Offences Act, 1957) repealed the 1927 and 1950 acts and replaced them with a clause prohibiting sexual intercourse or "immoral or indecent acts" between white people and anyone not white. It increased the penalty to up to seven years imprisonment for both partners. The 1957 act also prohibited brothel-keeping, procuring, and living off the proceeds of prostitution; and it prohibited sexual intercourse with people under the age of sixteen.
The Immorality Amendment Act, 1969 (Act No. 57 of 1969) amended the 1957 act to introduce or expand a number of offences. It prohibited the manufacturing or sale of any "article intended to be used to perform an unnatural sexual act" (i.e. sex toys). Despite the fact that sex between men was already prohibited under the common law crime of sodomy, the 1969 act made it a statutory crime for a man to have sex with another male under the age of nineteen. It also introduced section 20A, the infamous "three men at a party" clause, which prohibited any sexual activity between men at a party, where "party" was defined as any occasion where more than two people were present.
The Immorality and Prohibition of Mixed Marriages Amendment Act, 1985 (Act No. 72 of 1985) repealed the provisions of the 1957 act that prohibited interracial sex, and repealed the Prohibition of Mixed Marriages Act. This came as part of the repeal of many petty apartheid laws under the government of P. W. Botha. This act specifically deleted the definitions of "coloured" and "white" within the act, and repealed Section 16 of the 1957 act which barred interracial, extramarital sex.
The Immorality Amendment Act, 1988 (Act No. 2 of 1988) renamed the Immorality Act, 1957 to the Sexual Offences Act, 1957. It criminalised, for the first time, a woman having sex with a person under the age of consent, for that purpose setting the age of consent at 16 for a boy and 19 for a girl. It also made it a crime to be a prostitute, where previously only certain acts related to prostitution (brothel-keeping, procuring, etc.) had been illegal. The legislation also noted that either gender could now be convicted of sexual offences.
The Criminal Law (Sexual Offences and Related Matters) Amendment Act, 2007 repealed most of the remaining provisions of the 1957 act. The only provisions still in force are those related to prostitution.
The men-at-a-party offence (section 20A) was invalidated in 1998 by the Constitutional Court in the case of National Coalition for Gay and Lesbian Equality v Minister of Justice. The increased age of consent of nineteen for same-sex sexual activity (as opposed to sixteen for opposite-sex sexual activity) was invalidated in 2008 in the case of Geldenhuys v National Director of Public Prosecutions, although by that time the discriminatory provisions had been repealed by the 2007 amendment act.