Comcast on Monday agreed to shed millions of subscribers in an attempt to allay concerns it will be too big and powerful if it is allowed to buy Time Warner Cable.

And by selling those subscribers to a company that has been openly critical of the proposed merger, Charter Communications, Comcast removed another obstacle to the deal.

Comcast said it would sell 1.4 million subscribers outright to Charter Communications and spin off 3.5 million subscribers into a separate company co-owned by Comcast and Charter.

The complicated transaction with Charter, valued at about $20 billion, is contingent on a successful regulatory review of Comcast’s merger with Time Warner Cable. Subscribers affected are in Los Angeles, Dallas, Minneapolis and Detroit, but the companies declined to elaborate on specific plans.

In the announcement, Charter said it would become the nation’s second-largest cable operator with 5.7 million subscribers. With its 33 percent ownership in a spinoff company co-owned with Comcast, Charter would have direct and shared control of 8.2 million subscribers.

Charter’s president and chief executive, Tom Rutledge, touted the purchase of subscribers as good for consumers and competition in the rapidly consolidating industry.

“The transactions announced today will provide Charter with greater scale, growth opportunities and improved geographical rationalization of our cable systems, which in turn will drive value for shareholders and more effective customer service,” Rutledge said.

He also retreated from earlier warnings about Comcast’s union with Time Warner Cable, a company that Charter had tried to acquire. Charter had warned that Comcast and Time Warner Cable would combine the nation’s top two cable and broadband Internet service providers, giving them too much of an advantage over smaller rivals.

“From the regulatory perspective, it is difficult to imagine a transaction that could concentrate the industry more than the proposed Comcast merger,” Charter warned Time Warner Cable investors last month.