Anthem Inc. agreed to buy Cigna Corp. for $48.4 billion in a transaction that, along with a previously proposed combination of rivals, could reshape the U.S. health-insurance industry.

The deal, which follows months of speculation and at-times contentious talks, combines the second- and fifth-largest health insurers by revenue and merges two companies with a huge footprint in commercial insurance, the type of coverage provided to employers and consumers.

The merged company is projected to have around $115 billion in annual revenue and cover about 53.2 million people. The deal and its price was first reported by The Wall Street Journal earlier this week.