As my comparative anthropology professor likes to remind me (although I'm not sure I necessarily agree)...

"Sex" is based on physical characteristics, while "gender" is a social construct based on the characteristic social roles of each sex.

And if anyone takes "Sex is based on physical characteristics" out of context....