By Colin Kellaher

Johnson & Johnson on Wednesday said it agreed to buy Momenta Pharmaceuticals Inc. for about $6.5 billion, or $52.50 a share, in cash.

The deal represents a roughly 70% premium to Tuesday's closing price of $30.81 for Momenta, a Cambridge, Mass., biotechnology company focused on developing treatments of rare immune-mediated diseases.

Johnson & Johnson said the deal would broaden the position of its Janssen Pharmaceutical Cos. unit in immune-mediated diseases and allow the unit to expand into autoantibody-driven disease.

Momenta's lead asset, nipocalimab, recently received rare-pediatric-disease designation from the U.S. Food and Drug Administration for the prevention of hemolytic disease of the fetus and newborn, a serious blood disorder. Johnson & Johnson said it expects nipocalimab to contribute to Janssen's goals of achieving above-market growth over the mid and long term.

Johnson & Johnson said it expects to complete the acquisition by the end of the year.

Shares of Momenta surged 68% to $51.86 in premarket trading Wednesday.

Write to Colin Kellaher at colin.kellaher@wsj.com