Eurotunnel has been paid £33 million by the government in exchange for dropping legal action against the Department for Transport over post-Brexit ferry contracts.
The Channel Tunnel operator had begun legal proceedings over the way in which the DfT handed out ferry contractors to three suppliers - arguing that the process had not been transparent.
But on Friday, the Government announced a deal with Eurotunnel to "deliver improvements which will ensure the Channel Tunnel is ready to continue to keep passengers and freight moving post-Brexit", such as better security and traffic flow at the border.
The DfT said this will protect the "vital freight capacity" purchased from ferry operators to help ensure the continued supply of "crucial medicines, medical supplies and veterinary medicines in a no-deal scenario".
Transport Secretary Chris Grayling said: "The agreement with Eurotunnel secures the Government's additional freight capacity, helping ensure that the NHS has essential medicines in the event of a no-deal Brexit.
"While it is disappointing that Eurotunnel chose to take legal action on contracts in place to ensure the smooth supply of vital medicines, I am pleased that this agreement will ensure the Channel Tunnel is ready for a post-Brexit world."
Health Secretary Matt Hancock, who relies on cross-channel freight for the transport of medicine to the NHS, claims to be glad a deal has been reached with Eurotunnel, despite its price tag.
He said: "Oh it's a very, very important agreement that's been reached today, because it means that we can have confidence in our plans to ensure that the supply of medicines will continue unhindered whatever the Brexit scenario."
Brexit Secretary Stephen Barclay said: "Our focus is firmly on delivering a deal but it is important we prepare for all scenarios.
"We are taking steps to ensure supply chains continue to function, whatever the circumstances of our departure, and that mitigation is in place to avoid disruption at borders."
Labour renewed their criticism of Mr Grayling, accusing him of leaving a "trail of destruction" and calling for his dismissal.
Andy McDonald MP, Labour's Shadow Transport Secretary, said: "On the same day a National Audit Office report highlights that disastrous decisions by Chris Grayling at the Ministry of Justice have wasted nearly half a billion pounds of public money we also learn that the Transport Secretary's misjudgement over the award of a ferry contract has left taxpayer’s liable for £33 million in compensation to Eurotunnel.
"This follows a damning Public Accounts Committee report on Wednesday on his mismanagement of the railways.
"His conduct as a minister is one of serial failure and routine incompetence.
"In any other sphere of life he would have been sacked long ago. I say yet again: this trail of destruction has gone on long enough. It’s time for Chris Grayling to go."