The Kray twins' biopic Legend broke UK box office records as it stole the top spot in the UK and Ireland this weekend.

The film took in £5.18 million across 522 sites, making it the UK's biggest September release and the biggest ever opening for a British production with an 18 certificate.

Tom Hardy's performance as East End gangsters Reggie and Ronnie Kray knocked the hip-hop biopic Straight Outta Compton from number one. New release Maze Runner: The Scorch Trials debuted in second place.

Producers Studiocanal also announced that Legend was their widest ever release and had become their biggest UK opening of all time, beating 2014's Paddington which took £5.11m.

Danny Perkins, chief executive of Studiocanal, said: "We worked closely with the film-making team as they crafted a superb film around a truly unique central performance and it has been fantastic to see this inspire such an incredible amount of excitement and appreciation from UK audiences."

Despite its British subject matter, the film was shown at the Toronto International Film Festival on September 12 to critical acclaim. Hardy's role in the Brian Helgeland-directed crime thriller has already garnered Oscar buzz.

The film attracted attention in the UK last week for "brazenly" sneaking a two-star review among four-star reviews on its film poster. Guardian writer Benjamin Lee praised the marketing department's "chutzpah" and "promotional sleight of hand" for making it look like he gave them a higher review.