After months of dark skies, the future suddenly looks sunny for Celgene’s multiple sclerosis drug.

Celgene’s MS treatment ozanimod was in a race to hit the market before Novartis’ MS drug Gilenya went off patent. However, the tides have turned after the patent office granted another nine years of exclusivity to Gilenya on Thursday.

This decision will also give ozanimod more time to establish itself in the market before an onslaught of MS generics appear, an analyst from Evercore said in a note.

Celgene’s MS drug hit setbacks early this year, including the FDA turning away its approval request for ozanimod and top executives departing the company. The company’s shares plummeted after analysts projected the MS treatment could be delayed up to three years.

However, with the patent extension, Celgene can anticipate at least three years of generic-free sales after its 2019 launch, according to Evercore senior analyst Umer Raffat.

He said he expects Gilenya’s extended patent won’t last until 2027, but will be challenged by generic makers including Sun Pharma, Teva, and Apotex. Yet because that ruling is two or three years away, the analysts predict, Celgene’s MS drug has plenty of time to establish itself as a branded MS treatment.

Last year, Gilenya brought in the most revenue of any drug for Novartis, with annual sales of $3.2 billion. Despite the lack of generic competition, Celgene will compete against several blockbuster drugs other than Gilenya, including Biogen’s Tecfidera, Teva’s Copaxone, and Roche’s Ocrevus.