Reynolds American agreed Tuesday to buy its smaller rival, Lorillard, for $27.4 billion, uniting two of the country’s largest tobacco producers in a bet that bigger is safer in a declining industry.

Under the terms of the deal, Reynolds will pay $68.88 in cash and stock for every Lorillard share and assume its debt.

Two other companies are also involved in the complicated transaction. The Imperial Tobacco Group will pay $7.1 billion for several brands — including Kool, Salem and Winston cigarettes, and Blu e-cigarettes — and acquire a former Lorillard manufacturing plant, which employs about 2,900 people in Greensboro, North Carolina.

And British American Tobacco, which already owns 42 percent of Reynolds, will spend about $4.7 billion to buy additional shares to maintain that level of ownership in the combined company and help finance the deal.

The long-awaited combination, over a year in the making, will reshape America’s tobacco industry as companies grapple with a decades-long drop-off in smoking. Buying Lorillard will make Reynolds a stronger competitor to the Altria Group, whose Marlboro brand alone accounts for nearly half of all cigarette sales in the United States.

Perhaps more important, the deal will also give Reynolds a foothold in one of the fastest growing products in the industry: menthols. Lorillard owns Newport, the bestselling brand of menthols, which represents roughly 12 percent of the overall cigarette market.

The combined company’s flagship brands also will include Camel, Pall Mall and Natural American Spirit cigarettes and Grizzly smokeless tobacco.

Under the deal, Lorillard shareholders will receive $50.50 in cash and 0.2909 of Reynolds stock. They will own about 15 percent of the combined company following the deal.

The combined company expects to achieve about $800 million in annual cost savings as part of the deal. The deal is subject to regulatory and shareholder approval and is expected to be completed in the first half of 2015.

Analysts have said that the four-way transaction could spur other mergers in the industry, particularly as established manufacturers seek to gain ground in e-cigarettes.