In a widely anticipated move, CBS and Viacom have agreed to reunite.

The two media giants split back in 2006, although the Redstone family maintained control through National Amusements, a privately held holding company. Now they’re coming back together in an all-stock merger, creating a new entity with the straightforward-but-ungainly name ViacomCBS.

The move is, in some ways, a concession to a turbulent media environment driving large-scale M&A, with AT&T buying Time Warner and Disney acquiring most of Fox — both deals seen as consolidation in preparation for a streaming-centric future. Similarly, once this deal is done, ViacomCBS is expected to make more acquisitions of its own.

It’s also a victory for Shari Redstone, who’s been pushing for the merger over the opposition of some CBS executives — when CBS CEO Leslie Moonves resigned last year in a scandal over sexual harassment allegations, he also paved the way for this merger.

Viacom CEO Bob Bakish will become CEO of the combined organization, while Joe Ianniello will continue to serve as chief executive at CBS, and Redstone becomes chair of the combined company’s board of directors.

“My father once said ‘content is king,’ and never has that been more true than today,” Redstone said in a statement. “Through CBS and Viacom’s shared passion for premium content and innovation, we will establish a world-class, multiplatform media organization that is well-positioned for growth in a rapidly transforming industry.”

Brands owned by ViacomCBS include CBS (obviously), Showtime, Nickelodeon, MTV, BET, Comedy Central and Paramount Network, as well as the film studio Paramount Pictures.

In their announcement, the companies note that the merger creates a joint content library that includes more than 140,000 TV episodes and 3,600 films, and “reunites fan-favorite franchises such as Star Trek and Mission: Impossible” (which were previously split between Paramount on the film side and CBS on the TV side). They also say that this will allow them to “accelerate” their direct-to-consumer strategy, which includes offerings like CBS All Access, Showtime and Pluto TV.

The deal is expected to close by the end of 2019.