Comcast is buying the rest of NBC Universal from General Electric several years ahead of schedule to take advantage of low interest rates and what its chief executive calls a "very attractive price" of $16.7bn (£10.7bn).

The nation's leading cable TV company also agreed to pay GE another $1.4bn for other assets that include one of New York's best-known landmarks, NBC's headquarters at 30 Rockefeller Plaza. The building was the setting for the NBC comedy series 30 Rock, a fictional version of the broadcast network that skewered the management of both GE and Comcast before airing its final episode two weeks ago.

Investors thought the move was good for both companies – GE because it got cash for its stake earlier than expected and Comcast because it will benefit more from the rising price of sports rights and other TV programmes. With the NBC Universal businesses, Comcast avoids solely being in the uncomfortable position of passing those costs on to consumers. That was one reason Comcast bought a majority stake in NBC Universal two years ago.

Comcast also raised its annual dividend 20% to 78 cents per share and vowed to buy back another $2bn in shares this year. Following Tuesday's announcement, Comcast's stock jumped 7% in after-hours trading. GE's stock rose almost 4%.

Comcast's business as a cable TV, internet and phone provider generates nearly two-thirds of the company's revenue. The NBC Universal business makes up the rest and includes the NBC and Telemundo broadcast networks, pay TV channels such as USA, CNBC, Bravo and SyFy, the Universal Pictures movie studio and theme parks in Florida and California.

Comcast has owned 51% of NBC Universal since January 2011, and GE the rest. Comcast had planned to take a larger stake in NBC Universal over seven years, paying for it from operating cash, starting in July 2014.

But chief executive Brian Roberts told The Associated Press that the sale of Comcast's stake in pay TV network A&E and some wireless spectrum gave it plenty of cash on hand. He also said Comcast got a good deal given that the market value of media conglomerates has been rising.

"We thought that we would have to pay more later," he said. "We really have known we wanted to buy 100% from the beginning of the transaction. We wanted to learn the business. We feel that now is an opportune time."

GE's history with NBC goes back to 1919, when it co-founded the Radio Corporation of America. RCA created NBC as a radio network, calculating that people would buy its radios if they had interesting things to listen to. RCA took full ownership of NBC in 1932, but GE bought it back in 1986 to get a reliable source of cash while overseas manufacturing competition loomed.

In selling the remaining stake to Comcast, GE would free up cash to accelerate its share repurchase program to approximately $10bn in 2013. It is another step in the Fairfield, Connecticut, company's efforts to focus on less glamorous – but theoretically more profitable – ventures such as manufacturing medical imaging equipment, aeroplane engines and electrical generators.

"This transaction allows us to significantly increase the cash we plan to return to shareholders in 2013, to approximately $18bn, and to continue to invest in our industrial business," GE chief executive Jeff Immelt said.

The deal, expected to close by the end of March, values NBC Universal at around $34bn. It has about $5bn in debt. When Comcast bought the 51% stake in the company in January 2011, it was valued at around $30bn.