UK-based bookmaker Betfred has been chosen to buy the Tote after an auction process that began in November.
Betfred, the country's fourth-biggest bookmaker, will pay £265m for the business.
The sale is subject to consultation with the Tote's employees and is expected to be completed in about four to eight week' time.
The Tote has 517 High Street shops and the monopoly to run pool betting online and at 60 UK racecourses.
The sale agreement signals the end of a long-running saga over the planned privatisation of the betting group, which employs more than 4,000 staff.
Betfred's rival in the auction was Sport Investments Partners (SIP), a consortium led by the British Airways chairman Martin Broughton.