General Electric Co and Vivendi SA have agreed in principle to a deal in which GE would buy the French company's 20-percent stake in NBC Universal for $5.8 billion, a source familiar with the matter said on Monday, paving the way for Comcast Corp's proposed joint venture with GE.

The agreement is mainly a result of a meeting between GE Chief Executive Jeffrey Immelt and Vivendi's CEO Jean-Bernard Levy in Paris last week, where the two parties made progress on the talks that had been going on for weeks, the source said.

Vivendi had originally valued its 20-percent stake in NBC Universal, acquired in 2004, at $6.1 billion, sources told Reuters earlier this month. But the two sides differed on that valuation, slowly narrowing their gap over the past few weeks. GE, which owns the remaining 80 percent, had offered around $5.6 billion about 10 days ago, a source had said then.

The negotiations between Vivendi and GE have been holding up Comcast's plan to form a joint venture with GE by buying a 51-percent stake in NBC Universal.

GE and Comcast have agreed to value NBC Universal at about $30 billion, sources previously told Reuters. But for that deal to happen, GE has to buy out Vivendi's stake first.

With the tentative agreement between GE and Vivendi, an announcement on the Comcast-GE deal could come in the next few days, two sources familiar with the matter said.

Comcast would contribute its cable networks and $4 billion to $6 billion in cash to the joint venture.

GE and Comcast declined to comment. A Vivendi spokeswoman did not immediately return a call seeking comment.

(Reporting by Jui Chakravorty, additional reporting by Anupreeta Das; Editing by Richard Chang and Carol Bishopric)