Amazon has agreed to buy film studio MGM for $8.45bn, the two companies said in a statement.

The deal brings together “nearly a century of filmmaking history” at MGM with Amazon Studios, which makes films and TV series for customers of its Prime subscription service, they said.

“Amazon will help preserve MGM’s heritage and catalogue of films, and provide customers with greater access to these existing works,” the statement added.

Confirmation of the deal, which was first reported to be in the works last week, is the latest big move in the battle for video streaming – after Warner Media was spun off by owner AT&T to merge with Discovery.

It hands Amazon a wealth of content – from films such as Rocky, Robocop and Singin’ In The Rain to reality TV staples such as The Real Housewives of Beverley Hills – as it takes on the likes of Netflix and Disney+.

The acquisition is Amazon’s second biggest after it snapped up grocery chain Whole Foods for nearly $14bn in 2017.