UPDATE 2-Allergan's profit beats; migraine drug succeeds in key study

(Adds profit forecast and details on migraine drug and fourth quarter results)

Feb 6 (Reuters) - Allergan Plc on Tuesday reported a better-than-expected quarterly profit on strong demand for Botox, and said its migraine treatment met the main goals in a late-stage study.

The key data could ease some investor concern at a time when Allergan faces the threat of competition from generic drugmakers.

Allergan's shares were marginally up before the bell.

The company lost nearly a fifth of its value last year. In comparison, the wider S&P 500 healthcare index rose 20 percent.

Botox sales jumped nearly 17 percent to $864.3 million in the fourth quarter ended Dec. 31, above consensus estimates of $778.20 million, according to Thomson Reuters I/B/E/S. Sales of dry-eye drug Restasis rose nearly 1 percent to $414.9 million, ahead of estimates of $388.6 million.

Allergan said on Tuesday that patients on its migraine treatment were relieved of pain after two hours and did not experience migraine symptoms compared to a placebo, meeting the main goals of the first of two late-stage studies.

The Dublin, Ireland-based company, which is expected to report data from the second trial in the first half of 2018, said it would file for a marketing application for the migraine drug, ubrogepant, next year.

Ubrogepant belongs to a class of migraine drugs being developed by rivals such as Eli Lilly, Amgen and Alder Biopharmaceuticals that target a protein associated with pain signaling called CGRP.

Allergan said on Tuesday it recorded a gain of about $2.8 billion in the fourth quarter ended Dec. 31, related to recent changes to the U.S. tax law, helping it post a profit after six straight quarters of loss.

Net profit attributable to shareholders was $3.05 billion, or $8.88 per share, in the quarter, compared with a loss of $70.2 million, or $0.20 per share, a year earlier.

Excluding items, the company earned $4.86 per share, beating the average analyst estimate of $4.74.

Net revenue rose 12 percent to $4.33 billion, above analysts' estimates of $4.28 billion.

The company also forecast 2018 adjusted profit per share in the range of $15.25 to $16.00. Analysts on average were expecting $15.50. (Reporting by Manas Mishra in Bengaluru; Editing by Maju Samuel and Sayantani Ghosh)