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, 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, according to a proxy filing last month with the Securities and Exchange Commission.

Charter urged Time Warner Cable shareholders to reject the merger.

Comcast and Time Warner Cable will control more than 40 percent of the broadband Internet market, the fastest area of growth for cable firms adapting to consumer preferences for viewing entertainment and news online.

Consumer groups have said the combined company would have too much influence over the vast ecosystem of television programmers, TV equipment makers, Web content firms and device manufactures that will have to negotiate for access to Comcast’s 30 million cable subscribers.

Charter defended its deal with Comcast, saying its growth in subscribers will create a stronger competitor. It will be less than one-fifth the size of Comcast.

“We feel the deal is good for Charter but, just as important, good for the industry because it creates a strong number two player that will make it a healthier industry,” Charter spokesman Alex Dudley said.

Consumer advocates said Charter’s deal quiets a key critic. Netflix, which has battled Comcast over costs to deliver streaming videos, has opposed the merger. Back9Network, a golf lifestyle cable channel, said in a congressional hearing last month that its talks with Time Warner Cable “stalled” once the merger was announced.

“The incentive is for the merged company not to carry us,” said James Bosworth, chief executive of the Hartford-based network.

Few other corporations have been willing to rebuke the merger, fearing retribution, consumer groups say.

Comcast and Time Warner Cable have argued that their deal doesn’t present antitrust concerns because they don’t compete in the same markets. Regulators will also evaluate more broadly if the deal is good for the public. With its NBC Universal media assets, vast network of cable systems and powerful broadband Internet connections, Comcast will have to defend itself against critics.

“The Charter deal is like a bribe,” said Mark Cooper, a researcher for the Consumer Federation of America. “Now that Charter got what it wants, there’s no more criticism.”

Follow The Post’s new tech blog, The Switch, where technology and policy connect.