The researchers studied 13- to 25-year-olds. They defined psychosis as hallucinations, delusional disorder, schizophrenia spectrum disorder, major depressive disorder, bipolar disorder with psychotic features or unspecified psychosis.

The potential of developing psychosis was greater in younger patients who take amphetamines, such as Adderall or Vyvanse, than those taking methylphenidates, such as Ritalin or Concerta, according to a study published in the New England Journal of Medicine on Wednesday.

Certain medications commonly used to treat ADHD in teens and young adults may increase their risk of psychosis, according to new research from Harvard Medical School and McLean Hospital.

Although the risk is low, the data come at a time when prescription rates and diagnoses of attention deficit hyperactivity disorder are on the rise. Two researchers published in the JAMA Network Open this past August said that in a 20-year period they "found a significant increase in the prevalence of diagnosed ADHD."

It's not clear whether more children have ADHD or more are being diagnosed, according to the Centers for Disease Control and Prevention.

Either way, Dr. Lauren Moran, the lead author studying psychosis and prescription medications, said the use of amphetamines has more than tripled recently.

"There is not a lot of research comparing the safety profiles of amphetamines and methylphenidate, despite increasing use of these medications," Moran said in a statement. Doctors have noted "patients without previous psychiatric history coming with psychosis" following stimulant use in the past, however.

Researchers analyzed 221,816 patients with ADHD between Jan. 1, 2004, and Sept. 30, 2015. One out of every 486 patients taking amphetamines later required treatment for psychosis, while patients on methylphenidate had a risk of 1 in 1,046. Overall, about 1 in 660 patients reported new-onset psychosis and were prescribed an antipsychotic medication.

The study only covers youth who had been recently diagnosed with ADHD and started taking medications and not those who were already being treated with medication.

"People who have been on a drug like Adderall for a long time who are taking the drug as prescribed and are tolerating it well are not likely to experience this problem," Moran noted.

There were limitations to the study, as it did not cover those with public insurance or who were uninsured.

Authors also noted possible misuse of these stimulants. Adderall is popular among college students who use it to help them study. But if that had skewed findings at all, researchers said they would have expected larger effect sizes among college-age patients, which they did not.

WATCH: Doctors may soon treat cognitive diseases with video games