Novo Nordisk A/S has agreed to buy the global rights to Xoma Corp.’s Type 2 diabetes treatment in a deal worth up to $295 million.

The price tag includes a $5 million upfront payment to Xoma and up to $290 million in milestones. Xoma also is eligible for royalties on product sales.

Shares of Xoma rose 24% in recent premarket trading to $1.65 a share.

Novo Nordisk will receive the exclusive development and commercialization rights to Xoma’s allosteric monoclonal antibodies that regulate insulin receptors. Xoma will keep the commercialization rights for rare diseases, though Novo Nordisk has the right to add those indications to its license.

Novo Nordisk has been growing its roster of diabetes treatments.