Boys do better at school when taught by men, while women help improve girls' performances, US research suggests.
Girls are less likely to enjoy lessons taught by men, research suggests
A study of 25,000 pupils by Stanford University economist Thomas Dee found children did 4% better in tests when their teachers were of the same sex.
Schools should "keep an open mind" about how to raise the achievements of male and female pupils, he said.
But Professor Dee said this should not necessarily mean introducing more single-sex classes.
The research, based on the US-wide National Education Longitudinal Survey, found that a teacher's gender had "large effects on student test performance".
The report adds: "Simply put, girls have better educational opportunities when taught by women and boys are better off when taught by men."
When a woman was in charge of a class, boys were "more likely to be seen as disruptive".
Meanwhile, when taught by a man, girls were "more likely to report that they did not look forward to a subject".
Professor Dee said educationalists should "hesitate" before advocating more single-sex classes, which could have other "drawbacks".
But teachers could learn more about the "different learning styles" of boys and girls and receive more training "aimed at combating gender biases" in their own behaviour.
Prof Dee added: "Perhaps the best policy solution is to keep an open mind about a variety of strategies that neither unequivocally endorse single-sex education nor rule it out of order together."
In the UK, boys were outperformed by girls in this year's GCSE exams, but they improved at a faster rate.
A study earlier this year by London Metropolitan and Newcastle universities found that primary school pupils cared less about a teacher's gender than their overall ability in the job.
Meanwhile, a review of international research by Professor Alan Smithers of Buckingham University, has suggested that single-sex education does not make much difference to achievement.
The "ability and social background of the pupils," were more important, he concluded in a report published earlier this year.
The Stanford University study - The Why Chromosome - is published in the Education Next journal.