Biogen said Tuesday that its recently-approved drug for a rare infant disease had generated far more revenue in the first quarter of 2017 than analysts expected, lifting shares of the Cambridge biotech.

Biogen (Nasdaq: BIIB) reported $47 million in first quarter sales of Spinraza, which in December became the first drug approved to treat spinal muscular atrophy, a leading genetic cause of death in infants. That figure easily beat the consensus expectations, which varied but were mostly in the $15…