The discovery opens up the possibility that potential drug users could be screened to see if they are likely to develop an addiction.
A study of 670 cocaine addicts found they were 25 per cent more likely to carry the gene variant than people who did not use the drug.
Rainer Spanagel, professor of psychopharmacology at the Central Institute of Mental Health in Mannheim, Germany, who led the study, said: "If you are a carrier of this gene variant the likelihood of getting addicted to cocaine is higher. You can certainly use this as a vulnerability marker for cocaine addiction."
The "cocaine gene" is a variant of the CAMK4 gene and was identified after an initial study on mice.
Scientists believe cocaine addiction is as hereditary as mental health conditions including schizophrenia, and even more so than alcoholism.
Studies suggest genetic factors account for about 50 per cent of alcoholism while cocaine addiction is about 70 per cent genetic.
Professor Spanagel suggested those with the cocaine gene could receive counselling to prevent them becoming addicted.
They could also be given experimental vaccines, currently in development, which counter the addictive effects of the drug.
There are more cocaine users in Britain that anywhere else in Europe, according to the European Union's drug agency.
By Nick Allen
Last Updated: 12:54PM GMT 11 Nov 2008
Dear Drugs-Forum readers: We are a small non-profit that runs one of the most read drug information & addiction help websites in the world. We serve over 4 million readers per month, and have costs like all popular websites: servers, hosting, licenses and software. To protect our independence we do not run ads. We take no government funds. We run on donations which average $25. If everyone reading this would donate $5 then this fund raiser would be done in an hour. If Drugs-Forum is useful to you, take one minute to keep it online another year by donating whatever you can today. Donations are currently not sufficient to pay our bills and keep the site up. Your help is most welcome. Thank you.