It agreed with Australia, which brought the case in May 2010,  that the programme was not for scientific research as claimed by Tokyo.
Japan said it would abide by the decision but added it "regrets and is deeply disappointed by the decision".
Australia argued that the programme was commercial whaling in disguise.
The court's decision is considered legally binding.
Japan had argued that the suit brought by Australia was an attempt to impose its cultural norms on Japan.
Reading out the judgement on Monday, Presiding Judge Peter Tomka said the court had decided, by 12 votes to four, that Japan should withdraw all permits and licenses for whaling in the Antarctic and refrain from issuing any new ones.
It said Japan had caught some 3,600 minke whales since its current programme began in 2005, but the scientific output was limited.
Japan signed up to a moratorium on whaling in 1986, but continued whaling in the north and south Pacific under provisions that allowed for scientific research. Norway and Iceland rejected the provision and continued commercial whaling.
The meat from the slaughtered whales is sold commercially in Japan.
Japan has clashed repeatedly with Australia and some other Western countries, which strongly oppose whaling on conservation grounds.
Japan has argued that minke whales and a number of other species are plentiful and that its whaling activities are sustainable.
A spokesman for Greenpeace UK, Willie MacKenzie, welcomed the ICJ's decision.
"The myth that this hunt was in any way scientific can now be dismissed once and for all," he said.
The UN's International Court of Justice (ICJ) has ruled that the Japanese government must halt its whaling programme in the Antarctic.