Prior to the trial, the patients experienced 18 migraine days on average. Those that took the drug saw that number reduced by about 6.6 days, whereas patients who took the placebo only saw a reduction of 4.2 days. Amgen noted that the results are statistically significant for both groups.

In theory, Amgen's drug could help prevent migraines by inhibiting the receptors for calcitonin gene-related peptide. High levels of the molecule CGRP have been thought to be correlated with migraines.

Amgen said Wednesday that it has seen positive results for erenumab (aka AMG 334), the chronic-migraine prevention drug it has been developing with Novartis .

"Amgen and Novartis look forward to discussing these results with global regulators. We believe that together with the Phase 3 episodic data that we expect in H2, the data could potentially support both chronic and episodic indications being granted, at least by some of the global regulators," said Kristen Davis, spokeswoman for Amgen.



The results are not surprising "given the consistency in treatment effect we've seen from all the CGRP inhibitors in development," according to a Wednesday analyst note from JPMorgan published before the announcement.

"We continue to view AMG 334 as one of the more important growth drivers for Amgen over the near-to-intermediate term and recognize the commercial potential that chronic and episodic migraine present," the firm said, adding that there's intense competition.

Eli Lilly and Alder BioPharmaceuticals are also developing products in the migraine space.

In April, an analyst at Citi estimated that the drug could be a $1.5 billion opportunity for Amgen. The firm also said that the drug could provide an upside of $8 per share.

— CNBC's Meg Tirrell contributed to this report.