The law on rape in cases where an allegation is made after heavy drinking has been clarified by appeal judges.
A legal definition of consent in rape cases was established in 2003
Three Court of Appeal judges said someone who consumed "substantial" quantities of alcohol could still be capable of consenting to sex.
However, the judges said if a complainant lost the capacity to consent then that would amount to rape.
They addressed the issue in the case of Benjamin Bree, 25, from Southampton, who had his rape conviction quashed.
The computer software engineer had been found guilty of raping a 19-year-old student after an evening of heavy drinking.
Sir Igor Judge, Lady Justice Hallett and Mrs Justice Gloster said the appeal had required them to "address the effect of voluntary heavy alcohol consumption as it applies to the law of rape".
In making the ruling, Sir Igor said: "If, through drink - or for any other reason - the complainant has temporarily lost her capacity to choose whether to have intercourse on the relevant occasion, she is not consenting, and subject to questions about the defendant's state of mind, if the intercourse takes place, this would be rape.
"However, where the complainant has voluntarily consumed even substantial quantities of alcohol, but nevertheless remains capable of choosing whether or not to have intercourse, and in drink agrees to do so this would not be rape."
He added that the "capacity to consent may evaporate well before a complainant becomes unconscious".
It is the first time the Court of Appeal has looked at the issue since a legal definition of consent in rape cases was established by the Sexual Offences Act 2003.
The law says a person consents to sex if they agree by choice and have the freedom and capacity to make that choice.
Mr Bree had denied raping the woman, who cannot be named for legal reasons, but was convicted by a jury at Bournemouth Crown Court and jailed for five years last year.
The student said she had not consented to sex after they had been out in Bournemouth drinking vodka and Red Bull and cider.
The quashing of his conviction related to "deficiencies" in the trial judge's summing up, and Mr Bree was freed from prison on 13 March.
BBC News home affairs correspondent Danny Shaw says the guidelines are intended to clear up confusion around the law and may help prevent people being wrongfully convicted or wrongfully acquitted.