Comcast Corp. has reached an agreement to buy Time Warner Cable in a deal valued at $45.2 billion, according to people familiar with the negotiations.

The proposed blockbuster combination is expected to be announced Thursday and would create a video and Internet juggernaut with 30 million subscribers and operations in some of the country's biggest markets, including New York City, Los Angeles, Chicago, Philadelphia and Washington, D.C.

Besides its cable and Internet operations, Comcast also is the parent of NBCUniversal, which owns the NBC broadcast network, Universal Studios and several popular cable channels, including CNBC, MSNBC and USA Network

ON LOCATION: Where the cameras roll

Time Warner Cable also has been expanding into programming and owns two sports channels in Los Angeles.

Under the terms of the transaction, Comcast would pay $158.82 a share for Time Warner Cable, a nearly 18% premium over the company's latest stock price. Time Warner Cable shares closed Wednesday at $135.31. Comcast has offered 2.875 shares of its stock for each share of Time Warner Cable in the all-stock transaction.

Comcast's and Time Warner Cable's boards separately have approved the deal, according to people close to the matter. Time Warner Chief Executive Rob Marcus, who has been in his current position for only 44 days, will resign after the sale closes.

Comcast's surprise move pulled the rug out from under Charter Communications, another cable operator, which last month offered $132.50 a share for Time Warner Cable. That bid was rejected, and this week Charter unveiled plans to launch a proxy war to install new directors at Time Warner Cable.  

PHOTOS: Box office top 10 of 2013

In dismissing Charter's offer, Time Warner Cable said it would entertain a sale at $160 a share.

Charter had hoped to work with Comcast, with its deep pockets, to mount a takeover of Time Warner Cable.

But Comcast was not interested in being part of a hostile takeover and instead started negotiating its own deal to acquire 100% of Time Warner Cable. The deal came together in the last few days, according to knowledgeable people.

A Charter spokesman declined to comment on the deal, which was first reported by Comcast's business channel, CNBC.

The combination of Comcast and Time Warner Cable does not run afoul of any current Federal Communications Commission rules. 

PHOTOS: Biggest box office flops of 2013

However, the deal will probably face intense scrutiny from regulators and lawmakers, many of whom have expressed concern about media consolidation and its effect on consumers. 

Furthermore, the Comcast-Time Warner Cable deal comes only three years after Comcast acquired NBCUniversal, which took more than a year to win the approval of federal regulators.

To ease concerns, Comcast plans to sell cable systems serving about 3 million subscribers so that its national footprint does not exceed 30% of the country, people involved in the deal said. The 30% benchmark was the previous FCC cap on cable ownership until a federal court tossed out that rule in 2009.

Still, the immediate reaction from consumer activists was one of great worry. 

"This deal would be a disaster for consumers and must be stopped," Craig Aaron, president of Free Press, a media watchdog, said late Wednesday.