But the High Court based this on Mr Hunt's claim he was not imposing the contract, but rather working with NHS employers to implement it.

Addressing Mr Hunt, today's High Court ruling said: 'It is noted that the press has again today referred to the contract potentially being “imposed” by you. As you know, references to “imposition” have been deployed to assert “wrongly” that you are not aware of your legal powers.

'To avoid further complaints of this sort, we suggest that it is best when addressing this issue to spell out that the new contract will be introduced by you working together with NHS employers.'

Justice for Health, which includes GP registrar Dr Francesca Silman, raised more than £150,000 through online crowdfunding in order to bring its case.

The group said in a statement: 'Mr Hunt’s last minute legal acrobatics have saved him from losing the case but bring no comfort to the thousands affected by his actions in the last year.

'He did not previously clarify his position when faced with thousands of cancelled operations, a devastated workforce or a health service in chaos, but instead, only when his actions faced High Court scrutiny.'

The Department of Health welcomed the 'clear decision by the judge that the secretary of state acted entirely lawfully'.

A spokesperson said: 'We must now move on from this dispute to the crucial job making sure that patients now get the same high standards of urgent and emergency care every day of the week, which involves more than the junior doctors contract.

'We urge the BMA to remove all threat of industrial action so we can work constructively with junior doctors to address their wider concerns and best recognise their vital importance to the NHS.

For those who had sponsored Justice for Health, you should receive a long e-mail and this is the 'final message':

Our final message:''We have worked very hard to get this case to court and we are thankful to have had the opportunity to hold Mr Hunt to account. The judicial review proceedings were necessary to gain clarity in the law and force Mr Hunt to answer for his conduct.

We hope it sets a precedent for better ministerial conduct and deters the SoS from making statements about imposition on other NHS staff groups.After a short break, Justice for Health may explore further legal challenges and campaigns we could help take forward on behalf of NHS staff and patients.

Whilst we hoped for the top result, we have met our initial goal to extract clarity from the SoS and will now move on. We resolve to help the BMA to exert legal pressure in any way possible to combat the exploitation of NHS staff and annihilation of good quality patient care we have witnessed at the hands of this Health Secretary.''

Judgement:The Judgment begins by dismissing claims from the SoS that the case had “no merit”, and emphasises that the grounds presented were “serious and properly arguable” and an issue of “wider public importance”.

It was made clear that Jeremy Hunt is not imposing a contract on junior doctors, instead merely ‘recommending’ it to NHS employers:

“One significant consequence of this litigation therefore has been that the Secretary of State has, properly and reasonably, taken the opportunity to put his position beyond doubt. Without granting declarations I can nonetheless, formally, record the position of the Secretary of State as articulated in these proceedings. First, the Secretary of State does not purport to exercise any statutory power that he may have to compel employers within the NHS to introduce the proposed terms and conditions. Second, he acknowledges, therefore, that in principle individual employers are free to negotiate different terms with employees…”

Despite warnings from his own civil servants, and being aware that his language was causing confusion, the SoS continued to be unclear over the past year.

“…the Minister was warned that the expressions “imposed” and “imposition” had given rise to difficulties. Paragraph [4] of the briefing stated as follows:

4. It is noted that the press has again today referred to the contract potentially being “imposed” by you. As you know, references to “imposition” have been deployed to assert “wrongly” that you are not aware of your legal powers. To avoid further complaints of this sort, we suggest that it is best when addressing this issue to spell out that the new contract will be introduced by you working together with NHS employers.”

The SoS only provided clarity at the last moment, despite previous requests from doctors, politicians and the Justice for Health legal team. This has allowed him to avoid a legal ruling against him.

“Shortly afterwards and essentially in the course of these expedited proceedings the Secretary of State has formally provided elaboration and clarification of his decision”

His lawyers argued that junior doctors’ interpretation of parliamentary statements made by the SOS were unimportant and irrelevant. They claimed only the employers (as decision makers) interpretation should be considered. It was distressing for junior doctors and supporters in court to hear the argument presented in this way. The judge has made clear that this was not an acceptable argument, and that junior doctors and those affected by the SOS decision are legally entitled to clarity.“In the course of argument counsel for the Secretary of State argued that the addressees of the decision were essentially the employers since it was they who had the responsibility for taking decisions on employment matters at the local level and that was what the decision was really about. However, Mr Sheldon QC, for the Minister did (somewhat reluctantly) acknowledge that employees were also affected. In my view employees were manifestly a critical category of addressee of the decision.”The judge has dismissed the defence’s claim that junior doctors were fully aware the SoS was not imposing a contract, an argument that was met by audible gasps from those who were present in the High Court.

“I accept the evidence of the junior doctors that they were in genuine doubt as to whether or not there was any negotiating daylight left following the Minister’s statement and, further, construed the Statement as entailing the Secretary of State compelling introduction or implementation of the contract and thereby eradicating further negotiating options.”

The judge has pointed out that now there is clarity the SoS is not imposing a contract, there remains an opportunity for further negotiations. Employers have in principle the freedom to choose whether or not to adopt Hunt’s recommended contract.

“[SOS] now accepts that there is in principle negotiating daylight which exists. But I have accepted the Secretary of State’s analysis by looking, with the obvious benefit of hindsight, at the full range of relevant documents, the most important of which would not have been available to the junior doctors prior to this litigation.”