From Latin 'genus' (birth, kind) — originally a grammatical term, expanded to biological sex in the 15th c. and social identity in the 20th.
The state of being male or female, especially in social or cultural (as opposed to biological) contexts; in grammar, a classification of nouns and pronouns.
From Old French 'gendre' (modern French 'genre'), from Latin 'genus' (genitive 'generis') meaning 'birth, race, kind, class.' The word entered English as a grammatical term for the classification of nouns. Its use for biological sex emerged in the fifteenth century, and its distinction from 'sex' as a social/cultural construct became prominent in the mid-twentieth century through the work of psychologist John Money and
English 'gender' and 'genre' are doublets — both come from Latin 'genus' through Old French, but they were borrowed at different times and diverged in meaning. 'Gender' arrived in the fourteenth century meaning 'kind/type' (especially grammatical), while 'genre' was re-borrowed in the nineteenth century from modern French meaning 'a type of art or literature.'