Mumbai - Nestlé had gone to the court to challenge the nationwide government ban ordered by India's food safety watchdog in June after tests by some states found lead levels exceeded statutory limits in the hugely popular Maggi noodles brand.
The Swiss food giant has always maintained the product is safe to eat, and has continued to sell it in other countries.
Read: No poison in Maggi Two Minute Noodles in South Africa
In its judgment, the high court in the western city of Mumbai called the ban "arbitrary" and said it violated the "principles of national justice".
"We have examined the evidence in great detail. Since the petitioner Nestlé has already agreed not to make and sell Maggi until the food authorities are satisfied, we see no reason to allow any relief to food authorities," Justice Vidyasagar Kanade told the court.
"We direct that Nestlé send five samples from each batch of Maggi for testing to three labs and only if the lead is found to be lower than permitted will they start manufacturing and sale again."
Shares in Nestlé India rose nearly four percent after the ruling, which came a day after India said it was seeking damages of nearly $100 million from the company for "unfair trade practices".
The government filed a complaint with the National Consumer Disputes Redressal Commission seeking 6 400 million rupees in damages.
Read: Nestlé's Maggi noodles in hot water in India
In response, Nestlé said its noodles went through stringent testing at laboratories both in India and abroad.
"Each one of these tests have shown lead to be far below the permissible limits," it said.
It also said it does not add monosodium glutamate (MSG) to its products, and that the substance occurs naturally in many ingredients.
The government's food safety watchdog had said traces of MSG were detected in Maggi noodles and criticised the company for failing to include the substance in the list of ingredients.
Nestlé has sold its Maggi noodles for over three decades in India, and had 80 percent of the country's instant noodle market before the ban.
Read: Noodle crisis: How Nestlé's woes started
It emerged as one of India's five most trusted brands in a consumer survey conducted last year and has been endorsed by celebrities including Bollywood superstar Amitabh Bachchan.
According to Brand Finance, a consultancy firm, Maggi is set to lose over $200m (€180m) in brand value following the setback in India.
Maggi was previously valued at $2.4bn, Brand Finance said, adding that it had ranked the noodle manufacturer as the 23rd most valuable food brand in the world.
Nestlé chief executive Paul Bulcke told AFP in June the brand was 100 percent safe, and he was working to get it back on Indian shelves "as soon as possible".
"One can have facts on one's side but it's the perception that counts," Bulcke said, explaining the company's decision to withdraw and destroy the product in India.
Nestlé food scare spreads after lead poisoning claims
Maggi noodles slapped with a ban in India
Nestlé slashes sugar in Nesquik