The walkout is due to start at 8 pm on Sunday and was planned until 8 pm on Tuesday.
The Health and Social Care Secretary Steve Barclay said:
“I firmly support the right to take industrial action within the law – but the government could not stand by and let plainly unlawful strike action go ahead.
“Both the NHS and my team tried to resolve this without resorting to legal action, but unfortunately, following a request from NHS Employers, we took this step with regret to protect nurses by ensuring they are not asked to take part in an unlawful strike.
“We welcome the decision of the High Court that the Royal College of Nursing’s planned strike on 2 May is illegal.
“The government wants to continue working constructively with the Royal College of Nursing, as was the case when we agreed on the pay offer that was endorsed by their leadership.
“We now call on them to do the right thing by patients and agree derogations for their strike action on 30 May and 1 April.”