GSK PLC said Tuesday that it has agreed to buy clinical-stage biopharmaceutical company Affinivax, Inc. for up to $3.3 billion.

The healthcare company GSK, -0.81% GSK, +0.22% said that it will pay $2.1 billion upfront and up to $1.2 billion in potential development milestones and that the deal is expected to close in the third quarter.

The transaction will provide access to next-generation pneumococcal vaccine candidates and support the development of its vaccines and specialty medicines, GSK said.

Write to Kyle Morris at kyle.morris@dowjones.com