Gupta, who was posted as IFS- Group B officer in the Indian High Commission in Pakistan, was arrested on April 23 for allegedly violating The Official Secrets Act.
The woman officer was produced before the Chief Metropolitan Magistrate Kaveri Baweja after the end of her police custody.
During the chamber hearing, Delhi Police Special Cell sought two days further custodial interrogation of the accused, which was, however, refused by the court.
"Madhuri Gupta is sent to judicial custody till May 15," Yogender Dahiya, counsel for Gupta, told media persons outside the Tees Hazari court in New Delhi.
53-year-old Gupta was arrested after being called back from Islamabad where she was posted as Second Secretary in the Press and Information wing.
The official came under the scanner after she showed 'extra-ordinary' interest in areas beyond her role in the information wing of the mission.
Central security agencies then involved senior MEA officials by briefing them about her activities in Pakistan, which included supplying of sensitive and classified documents related to Indian activities in that country and Afghanistan.
A promotee officer of Ministry of External Affairs, Gupta was working in the Mission for nearly three years. She was well versed in Urdu and her services were utilised for translation and interpretation. Earlier, she was posted in the Indian Mission in Kuala Lumpur and worked with India Perspective, a magazine of the External Publicity wing of MEA.
How female spies changed the course of history
Madhuri case: Making an ass of ourselves
A mole in an Indian mission can do great damage
The story behind diplomat-turned-spy's arrest
Madhuri Gupta's motivation was revenge