Slaughter and May has once again topped the ranking of law firms by their share of UK listed companies, as the magic circle firm increases its total number of stockmarket clients.

The rankings, published by Adviser Rankings in association with audit and advisory firm Crowe, place Slaughters at the top of the overall table, after the firm added two listed clients in the latest quarter to take its total to 116.

Slaughters' new FTSE 100 clients included two that were elevated from the FTSE 250 – Ocado and Rightmove – as well as DS Smith, which it advised on its acquisition of European packaging rival Europac. One other FTSE 100 client, private hospital group Mediclinic International, was demoted to the FTSE 250.

Herbert Smith Freehills (HSF), meanwhile, remains in second place in the ranking, also adding two stockmarket-listed clients to reach a total of 112.

This quarter, Slaughters has retained its position at the top of both the FTSE 100 and FTSE 250 rankings, with its FTSE 100 client list increasing by one to 34.

The magic circle heavyweight also counts GlaxoSmithKline, 3i and Diageo among its FTSE 100 client list.

Slaughters has dominated the rankings for a number of years, but was beaten to top place by HSF for the first time in eight years last September, after Adviser Rankings changed its ranking criteria to include companies listed on the Specialist Fund segment of the London Stock Exchange for the first time.

That decision added 35 companies to its adviser rankings, 10 of which named HSF as adviser. The firm's FTSE 100 clients include Royal Mail, British American Tobacco and Sky.

HSF London corporate head Ben Ward said: "We have a very formal strategy to maintain relationships with FTSE clients, as they are very important to us. We aim to add real value to what companies want to do – we can do the M&A work but not all our listed clients want to do that, so we want to support them across all issues, including corporate governance, capital raising and disputes, for example."

He added: "Over the last 18 months, the M&A market has been pretty busy – we've seen a lot of big, standout transactions but a lot of relatively smaller deals too. While there are huge political challenges in the world currently, a lot of companies have got used to dealing with that. Shareholders in listed companies won't tolerate inaction and are becoming more directive and engaging more in the business, and companies are having to look more closely at how they maximise value as a result of this."

The top of the FTSE 100 table did not change on Q2, with Allen & Overy (A&O), Linklaters and Freshfields Bruckhaus Deringer joining Slaughters in the top five, along with HSF.

A&O and Linklaters share second place with 26 clients, Freshfields Bruckhaus Deringer in fourth (22) and HSF in fifth (17).

However, in the FTSE 250 ranking, A&O climbed into fourth place with 25 clients, knocking Freshfields into fifth, with 24 clients.

Looking ahead, Ward said: "For many successful businesses, the status quo is not good enough because if you stand still, someone else will move ahead of you. I think we'll see a lot of varied activity in the coming months, and that won't just be M&A but could include spinoffs and combinations."