AT&T has agreed to lease 9,100 of its cellphone towers to Crown Castle International Corporation and sell 600 of the units outright to the Houston-based tower operator for a combined total of $4.85 billion in cash, the telecommunications giant said late Sunday.

After sending out signals in March that it might be willing to unload the communication towers, Dallas-based AT&T sifted through offers from a handful of potential buyers before striking its deal with Crown Castle. AT&T says the lease rights run for an average of 28 years, and that the company has also agreed to sublease back the towers’ wireless capacity from Crown Castle for at least 10 years. The terms of the deal also give Crown Castle the right to purchase the leased towers for about $4.2 billion once the existing leases expire.

The other ompanies reportedly showing interest in the AT&T towers in recent months were American Tower and SBA Communications, according to Bloomberg, which noted in September that the proposed sale would provide AT&T with a cash infusion as it proceeds with both a $14 billion network improvement project and a stock buyback plan that could exceed $11 billion.

Crown Castle, the country’s largest wireless infrastructure operator, will control roughly 40,000 towers once the deal with AT&T closes—an event that is expected to come in the fourth quarter. Last year, Crown Castle paid $2.4 billion to acquire the rights to roughly 7,200 towers owned by T-Mobile USA.

Cravath, Swaine & Moore, which advised Crown Castle on the T-Mobile deal, is reprising that role on the agreement with AT&T. Cravath corporate partners Stephen Burns, Erik Tavze and Johnny Skumpija are leading the way for Crown Castle on the matter, with tax partner Andrew Needham also advising. The Cravath associates working on the deal are Christopher Fargo, Benjamin Hewitt, Rachel Kiwi, Jared Taylor and Curtis Weber.

Cravath also advised Crown Castle in obtaining $3.4 billion of committed financing for the agreement with AT&T. Partners Burns and Skumpija represented the company in connection with the financing, along with corporate partner George Zobitz, senior attorney Christopher Kelly and associate John Duffy. E. Blake Hawk serves as Crown Castle’s general counsel.

Sullivan & Cromwell, meanwhile, is acting as lead counsel to longtime client AT&T on the sale of the cellphone towers. The firm advised AT&T in July in connection with its $1.19 billion purchase of prepaid cellphone service provider Leap Wireless, and represented the company on its $780 million acquisition of Alltel’s U.S. wireless operations from Atlantic Tele-Network in January. S&C also advised AT&T on its doomed $39 billion attempt to buy rival T-Mobile in 2011— a deal that the Justice Department ultimately blocked on antitrust grounds.

The S&C team advising AT&T on its agreement with Crown Castle includes Los Angeles–based corporate partner Eric Krautheimer, as well as New York corporate partners Joseph Frumkin, Arthur Adler, and Anthony Colletta. Financing partner Robert Downes and environmental special counsel Matthew Brennan are also advising, along with associates Jason Anderson, Rebecca Crosby, Jacob Elghanayan, Zachary Jacobs, Stephen Pratt, Grace Shen, Adam Sofen and Ralston Turbeville Jr.

Bryan Cave also landed a role on the transaction, with partners Daniel Cullen and Philip Wright providing AT&T with tax advice on the agreement in Chicago and St. Louis, respectively. AT&T’s general counsel is Wayne Watts.