A patient's belief that a drug will not work can become a self fulfilling prophecy, according to researchers.
They showed the benefits of painkillers could be boosted or completely wiped out by manipulating expectations.
The study, published in Science Translational Medicine, also identifies the regions of the brain which are affected.
Experts said this could have important consequences for patient care and for testing new drugs.
Heat was applied to the legs of 22 patients, who were asked to report the level of pain on a scale of one to 100. They were also attached to an intravenous drip so drugs could be administered secretly.
The initial average pain rating was 66. Patients were then given a potent painkiller, remifentanil, without their knowledge and the pain score went down to 55.
They were then told they were being given a painkiller and the score went down to 39.
Then, without changing the dose, the patients were then told the painkiller had been withdrawn and to expect pain, and the score went up to 64.
So even though the patients were being given remifentanil, they were reporting the same level of pain as when they were getting no drugs at all.
Professor Irene Tracey, from Oxford University, told the BBC: "It's phenomenal, it's really cool. It's one of the best analgesics we have and the brain's influence can either vastly increase its effect, or completely remove it."
The study was conducted on healthy people who were subjected to pain for a short period of time. She said people with chronic conditions who had unsuccessfully tried many drugs for many years would have built up a much greater negative experience, which could impact on their future healthcare.
Professor Tracey said: "Doctors need more time for consultation and to investigate the cognitive side of illness, the focus is on physiology not the mind, which can be a real roadblock to treatment."
Brain scans during the experiment also showed which regions of the brain were affected.
The expectation of positive treatment was associated with activity in the cingulo-frontal and subcortical brain areas while the negative expectation led to increased activity in the hippocampus and the medial frontal cortex.
Professor Anthony Jones, Salford Royal Hospitals NHS Foundation Trust, said: "Work from our own lab and those of others indicates that expectations are a key driver to pain perception and to placebo analgesic effects. So this provides further confirmation of that idea in relation to drug effects.
"This has been demonstrated previously in relation to nitrous oxide analgesic effects, but the current study provides good evidence that this phenomenon is not due to the subject saying what they think the investigator wants to hear."
The researchers also say clinical trials, which are used to determine the effectiveness of drugs, should be modified.
"Rather than seeking to control for psychological components, trial designs could be developed that aim to maximize the effects of therapeutic agents by integrating the effects of expectation and active treatment."