The Lucknow bench of the high court Wednesday also ordered a judicial probe into the doctors' grievances and the police lathi charge on them.
The doctors initially refused to budge from their stand and were angered by the state's decision to slap ESMA (Essential Services Maintenance Act) on them.
However, after a long meeting post-midnight, they decided to withdraw the strike and honour the directives of the court, said Devendra Lalchandani, chairman of the action committee of the Indian Medical Association.
A delegation led by Lalchandani met Samajwadi Party (SP) chief Mulayam Singh Yadav in Lucknow Wednesday night.
The SP supremo assured the striking doctors that he was worried about the future and wellbeing of the junior doctors and would ask the state government to concede their demands.
The court also rapped the state government and sought to know within three weeks what action it has initiated against the errant police officials who cane charged the doctors inside the hospital premises.
It also ordered the transfer of the inspector general, deputy inspector general, and Senior Superintendent of Police (SSP) of Kanpur Yashaswi Yadav.
The doctors have demanded unconditional release of the 24 jailed doctors, withdrawal of cases against them and action against SP legislator Irfan Solanki and the SSP Kanpur.
Doctors in the state went on a strike March 1 after supporters of the legislator and Solanki himself bashed up some junior doctors at the Hallet Hospital in Kanpur Feb 28.
The subsequent cane charge angered the junior doctors further and doctors across the state joined the strike.