Comcast Corp. agreed Tuesday to buy the remaining 49 percent stake in media-entertainment giant NBCUniversal from its joint venture partner General Electric for $18.1 billion.

“This is an exciting day for Comcast as we have agreed to accelerate the purchase of NBCUniversal,” Comcast chief Brian Roberts said as the two firms announced the deal ending the joint venture created two years ago.