Carlsbad drugmaker Ionis Pharmaceuticals Inc. has earned $10 million from Janssen Biotech Inc. by licensing out its gastrointestinal (GI) drug candidate, IONIS-JBI1-2.5Rx.

The drug is designed to target an undisclosed target in the GI tract and is set to be tested for the treatment of a GI autoimmune disease.

As part of the deal, Janssen gets all global development, regulatory and commercialization responsibilities for the drug, but only after Ionis completes studies that enable the company to file an Investigational New Drug application with the FDA.

Under the terms of the agreement, Ionis is eligible to earn as much as $800 million in development, regulatory and sales milestone payments and license fees for these programs. Ionis will also receive tiered royalties that (on average) are double-digits on sales from any product that is successfully commercialized.

The Carlsbad company’s main priority has always been drug discovery rather than commercialization. Historically, its allowed Big Pharma to front the cash and take on sales and marketing for a chunk of the profit. Over the years, Ionis has partnered with pharma giants such as GlaxoSmithKline, AstraZeneca, Roche, Biogen and Bayer.

But some of these deals have gone sour in the past year. Ionis took a blow in May when a clinical hold was put on a GlaxoSmithKline-partnered trial for an experimental cardiac drug. Ionis’ shares dropped by as much as 40 percent on the news. A few weeks before that, AstraZeneca bailed on AZD5312, an early-stage Ionis drug meant to treat prostate cancer. The new deal with Janssen will provide a bit of relief after these recent setbacks.

Ionis stock (Nasdaq: IONS) has recovered about 25 percent since May, and is currently trading for $26.68 per share.