An agreement was reached with more than a fortnight to spare and will be a relief to UKTV, whose ad sales are handled by Channel 4.
Both Channel 4 and Group M were said to be keen to avoid another trading row after the 2013 dispute, when talks collapsed in the run-up to Christmas and the WPP buying agency boycotted the broadcaster during the first two weeks in January.
As part of the new deal, it is thought that Group M and its content arm, Group M Entertainment, will supply Channel 4 with some advertiser-funded shows in a similar way to the previous deal.
Group M controls about 30 per cent of the TV ad market and spends an estimated £250 million a year with Channel 4 whose sales house has an annual turnover of nearly £1 billion.
Channel 4 and Group M declined to comment.
Back in 2013, Channel 4 sales director Jonathan Allan and Group M head of broadcast trading Mark Collins issued a joint statement after the "long and complex" negotiation to resolve their stalemate.
State-owned Channel 4 is in a stronger position now as share of peak-time viewing between 8pm and 11pm is up about 7 per cent in the year to date, and the wider TV market has seen revenues rise strongly by around 8 per cent.
Group M is forecasting another strong year for TV next year, with revenue growth of around 7 per cent, and media buyers have fewer options if they want to boycott a TV ad sales house to win better terms.
There are now only three TV sales houses, ITV, Channel 4 and Sky.
Viacom shut the Channel 5 operation in May, following a lengthy boycott by WPP rival Omnicom over pricing, and moved its sales into Sky.
Media agencies have been increasingly agreeing multi-year deals, rather than annual agreements, because of the negotiation required.
Channel 4 is facing the threat of privatisation despite widespread support for the status quo in adland.
However, the Government received a boost last week when former Channel 4 chief executive Michael Grade said the "world has changed dramatically" and the broadcaster "needs to be freed up" by moving out of public ownership.
He added: "You could build a really big media business around it."
David Abraham, the current chief executive, rejected Grade's view, arguing that Channel 4's not-for-profit remit to provide edgy, alternative programming would be at risk in the private sector.
Abraham said his predecessor hailed from an "analogue" era and challenged him to a public debate.
A source close to Grade, now a Tory peer, suggested he wouldn't take up Abraham's offer.