The agreement also follows a January ruling from a federal appeals court that struck down the Federal Communications Commission’s net neutrality rules, saying the agency overstepped its authority. This type of deal between Comcast and Netflix might have been forbidden under a liberal reading of the F.C.C.’s rules.

The announcement on Sunday confirmed reports that had trickled out late last week, as close watchers of Internet traffic began to detect a more direct Internet path of Netflix videos to Comcast customers.

In recent months, Netflix had reported that delivery speed of its content to Comcast subscribers had declined by more than 25 percent, resulting in frequent interruptions and delays for customers trying to stream television shows and movies delivered through Netflix. Customers of other providers, including Verizon, also reported delays.

Comcast, Verizon and other Internet service providers denied that they were playing any role in slowing down traffic. Instead, they blamed the intermediaries that Netflix used to deliver its content to Comcast on its way to consumers. They said that those middlemen — companies like Cogent Communications — were trying to shove too much data through too small a pipe.

The agreement, which is expected to be put fully into effect in the coming weeks, had been many months in the making, well before the Time Warner Cable announcement. The contours of a deal were reached after a meeting between Brian L. Roberts, chief executive of Comcast, and Reed Hastings, the chief executive of Netflix, at the International Consumer Electronics Show in Las Vegas last month, as well as the engineering teams of both companies, said sources close to the deal.

The new arrangement will deliver an “even better user experience to consumers, while also allowing for future growth in Netflix traffic,” the companies said in their joint statement Sunday. Netflix will now deliver its content directly to Comcast rather than going through an intermediary.