I don't know if I would say recently, this distinction started becoming used in the early 60s which was almost 60 years ago.
Not where I grew up. UK, so we know the language fairly well.
Gender was used synonymously with sex before the differences between the things known as ascribed gender, gender identity, and sex were identified and became things that needed distinct labels.