Ladbrokes and Coral had to offload 359 betting shops in an attempt to allay competition concerns ahead of their merger.
As part of the deal Betfred has agreed to shell out £55m for 322 high street outlets and Stan James has agreed to pay £500,000 for 37.
Following the divestment, the CMA will now decide whether to rubber-stamp the merger, which would create the country's biggest bookmaker with around 4,000 betting shops.
Betfred boss Fred Done, said: “I am delighted to have an agreement in place to buy 322 shops from Ladbrokes/Coral.
“It shows that even in this digital age I still believe in betting shops and I want to invest in Britain’s high streets.
“I started with just one shop in 1967 with an emphasis on customer service and the best offers on the high street, this ethos will now be extended to even more betting shops and takes my estate to just under 1700 premises.
“I would like to take this opportunity to thank everyone involved in this deal.”
Ladbrokes boss Jim Mullen added: "The sale of these shops will clear the last significant hurdle to delivering on the merger with Coral and paves the way for our focus on completion and quickly delivering on the opportunities the merger offers."
Our BQ Bulletin emails will land in your inbox at 7.30am, Monday to Friday, with a mix of the latest local business news, national news, and features to inspire you. Sign up here!
Click here to read our privacy statement