The English word gender was originally just a polite alternative to the use of the word sex as a noun. The first use of gender in this sense is from the 15th century. Thus historically in English gender and sex were synonyms.
Feminists and others have now successfully changed the English language to the point that sex and gender are now considered to be entirely separate and many people don't realise that it was ever otherwise. The first attestation of gender being used in this sense was 1963.
Feminists assert gender is a social construct and entirely separate to biological sex.