

AT&T, thwarted by regulators nearly two years ago on a planned $39 billion acquisition of T-Mobile USA, is back in the merger hunt, albeit with a much smaller target.

The company said on Friday that it had agreed to acquire a smaller rival, Leap Wireless International, for nearly $1.2 billion, the latest sign of consolidation in the telecommunications industry.

AT&T is paying $15 a share in cash for Leap, a prepaid cellphone service provider, about 88 percent above Leap’s closing price on Friday. Under the terms of the deal, AT&T would gain five million new customers and acquire Leap’s network, licenses and retail stores. Leap had $2.8 billion of net debt on April 15.

Under the terms of the deal, Leap shareholders will also receive a contingent right to net proceeds from the sale of spectrum in Chicago that Leap bought for $204 million in 2012.

Leap’s stock more than doubled in after-hours trading on Friday, climbing to almost $17 a share. It closed Friday at $7.98 a share.

Leap, based in San Diego, operates under the Cricket brand name, which AT&T plans to retain. Its network covers about 96 million people in 35 states.

“Cricket’s employees, operations and distribution will jump-start AT&T’s expansion into the highly competitive prepaid segment,” said Brad Burns, an AT&T spokesman.

The deal comes after months of speculation about the future of AT&T and other wireless companies. Smaller carriers like Sprint and T-Mobile have recently found merger partners, fueling questions about AT&T’s strategy.

AT&T previously approached Leap in 2011 while it was pursuing a deal with T-Mobile. At that time, AT&T discussed the possibility of selling a piece of T-Mobile’s customer accounts to Leap. But the T-Mobile deal was later blocked by regulators.

Since then, analysts have wondered how AT&T would find a partner to help it grow and defend against increasing competition. In June, a Spanish newspaper reported that authorities had blocked a bid by AT&T for Telefónica, the Spanish carrier.

AT&T recently restarted an overture for Leap, with a deal coming together in a matter of weeks, a person briefed on the matter said. Previously, Leap had talked with others, including T-Mobile, MetroPCS and SoftBank of Japan.

With AT&T, Leap pushed for contingent value rights, potentially increasing the payout to the smaller service provider’s investors. The deal’s high premium may dissuade others from trying to jump in with rival offers, this person added.

Still, the deal for Leap is unlikely to solve AT&T’s challenges, said Craig Moffett, a telecommunications analyst who recently started his own firm.

“It does not really change the trajectory of AT&T or its deal-making,” Mr. Moffett said. “There’s not much that AT&T can do anymore in the United States. The rest of the wireless business is probably off limits for regulatory reasons.”

But for Leap, the deal “puts them out of their misery,” Mr. Moffett said. “The only real question for Leap is whether AT&T is the best and final offer.”

Driving the urgency of the consolidation is the hunt for valuable spectrum. If the deal goes through, Cricket customers will get access to AT&T’s 4G mobile network, and AT&T will expand Cricket’s reach. For AT&T, the deal will give it access to the prepaid market.

“The combined company will have the financial resources, scale and spectrum to better compete with other major national providers for customers interested in low-cost prepaid service,” AT&T said in a release on Friday.

AT&T said that shareholders representing about 29.8 percent of Leap’s stock had agreed to support the transaction, which is subject to a review by regulators. AT&T expects the deal to close in the next six to nine months.

Evercore Partners advised AT&T.

Lazard and the law firm Wachtell, Lipton, Rosen & Katz advised Leap.