Comcast on Thursday will announce its intent to acquire Time Warner Cable in a $45 billion deal that will combine the two biggest cable companies in the United States.

Comcast (CCV) has agreed to pay $158.82 per share of Time Warner Cable (TWC) stock, according to two people with direct knowledge of the transaction who insisted on anonymity because the deal will not be publicly announced until Thursday morning.

The two companies expect the merger to receive government approval and take effect by the end of the year, but regulators are likely to take a close look at the potential impact on consumers. Through the consolidation of Time Warner Cable, Comcast would be the dominant provider of television channels and Internet connections in roughly one in three American homes, a total unmatched by any other distributor.

The terms of the deal were first reported on Wednesday night by CNBC.

The impending deal ends months of jockeying for control of Time Warner Cable, which is the country's second biggest supplier of cable television service, with about 12 million subscribers in markets like New York City and Los Angeles. Charter (CHTR), a smaller cable company, had been attempting a takeover of the company, but had been rebuffed by Time Warner Cable's board and chief executive.

In mid-January, when Charter indicated that it would offer about $130 per share, Time Warner Cable called the price "grossly inadequate" and countered with a suggestion of $160 per share, very close to what Comcast ultimately offered. Comcast had cast a shadow over the negotiations, and had reportedly held talks with Charter about how to potentially divvy up Time Warner Cable's territories.

By swallowing up Time Warner Cable on its own, Comcast will gain even more leverage over the country's marketplace for television, broadband Internet and phone services. Comcast already has about 23 million television subscribers in markets like Philadelphia, where it is headquartered.

With the addition of millions of Time Warner Cable subscribers, Comcast will have even more muscle in its negotiations with cable channel owners like The Walt Disney Company (DIS) and Time Warner (TWC), the parent company of this website. (Time Warner Cable was spun off from Time Warner in 2009 and no longer has any connection to the owner of CNN, HBO and Warner Bros.)

Although cable providers in general have poor reputations, Comcast has received some high marks for its next-generation software and set-top boxes.

Time Warner Cable, on the other hand, has what the American Customer Satisfaction Index called an "industry low" score last spring. It has shed television subscribers in recent months for a number of reasons, including a protracted blackout of CBS and Showtime in several million homes. Comcast could theoretically improve Time Warner Cable's performance by bringing in its own software.

Related story: The Weather Channel's cable fight is the tip of the iceberg

But even before the official announcement of the deal, questions arose about whether Comcast will be allowed to expand its cable footprint so substantially.

Regulators used to enforce a rule that prohibited a single cable company from controlling more than 30% of the market. But Comcast led a challenge to that rule in the mid-2000s, and in 2009 a federal appeals court threw out the 30% cap.

Still, the Justice Department and other federal agencies will surely line up to scrutinize the proposed combination.

Ajit Pai, a Republican commissioner at the Federal Communications Commission, expressed doubt back in December about the possibility. "Precedents like this suggest an outright acquisition by Comcast of Time Warner Cable could face a number of hurdles in the Obama administration," Pai told The Wall Street Journal. "A Republican administration likely would be more inclined to approve a deal."

People with direct knowledge of the impending deal said that Comcast, in a nod to concerns about the size of the combined cable provider, would voluntarily divest local cable systems totaling about three million subscribers.

The two companies are likely to point out that they don't directly compete — Comcast has its own markets, like Philadelphia and Washington D.C., and Time Warner Cable has its own, like New York and North Carolina. The lack of overlap may temper antitrust concerns.

Analysts also pointed out on Wednesday night that Comcast is remarkably well connected in Washington. In fact, its chief lobbyist, David Cohen, was a guest at the White House state dinner for the French president on Tuesday night.

Related story: Court strikes down net neutrality rules

Comcast persuaded government agencies to approve its $30 billion bid for NBCUniversal in 2011. At that time it agreed to a number of conditions that were designed to prevent anticompetitive behavior. It could be compelled to do the same in this case.

On Wednesday night, some of the public interest groups that opposed the NBCUniversal deal, like Free Press, signaled immediate opposition to the consolidation involving Time Warner Cable.

"No one woke up this morning wishing their cable company was bigger or had more control over what they could watch or download. But that — along with higher bills — is the reality they'll face tomorrow unless the Department of Justice and the FCC do their jobs and block this merger," Free Press said in a statement. "Stopping this kind of deal is exactly why we have antitrust laws."

It appears unlikely that Charter, the other cable company chasing Time Warner Cable, would stand in the way of Comcast's bid. In a statement, it said, "Charter has always maintained that our greatest opportunity to create value for our shareholders is by executing our current business plan, and that we will continue to be disciplined in this and any other M&A activity we pursue."