Responding to a wave of consolidation in the telecommunications industry, the nation's third- and fourth-largest wireless phone operators have agreed on the terms of a deal to join forces.

Sprint and T-Mobile have talked about a combination for years but continued to put it off, each preoccupied with other deals and concerned about scrutiny from antitrust regulators.

But in recent days, the two sides have settled on the terms of a $32 billion deal that is likely to be announced this summer, people briefed on the matter said Wednesday.

Under the terms of the deal, which are still rough, Sprint would acquire T-Mobile for about $40 a share in cash and stock, a 17 percent premium to Wednesday's price.

Talks are continuing and could still fall apart. But the agreement on terms represents a turning point in a relationship between two companies that have long contemplated a merger.

Sprint and T-Mobile have decided to press ahead because their two main rivals, Verizon and AT&T, each with more than 100 million subscribers, continue to grow.

Verizon's balance sheet is stronger, after agreeing to take full control of Verizon Wireless last year in a $130 billion deal with Vodafone. Verizon is the largest wireless operator in the country and also provides landlines, cable television and business services.

AT&T, the second-largest wireless provider, recently agreed to acquire DirecTV in a $49 billion deal, which would give it control of the country's largest satellite television operator.

Meanwhile, the cable industry is also consolidating. Comcast and Time Warner Cable have agreed on a $45.2 billion deal that would create by far the largest cable television operator.

Together, these mergers and acquisitions by competitors of Sprint and T-Mobile have created a landscape that has increasingly marginalized the two smaller companies, which each have about 50 million subscribers and provide only wireless service.

Neither Sprint nor T-Mobile, on its own, would have the financial resources to compete against these larger players, nor the suite of offerings to attract customers who can get a whole host of offerings from rivals.

Should it be announced this summer, a deal to combine Sprint and T-Mobile would surely face regulatory scrutiny. Antitrust officials at the Department of Justice are already considering the implications of the Comcast and AT&T deals. This would add a third megadeal to the mix, and the regulators could consider the merits of all the deals at once.