Russian military vehicles roll along a road towards the separatist region of Nagorno-Karabakh, Friday, Nov. 13, 2020. AP
The top UN court, which rules in disputes between countries, at the same time said that Baku did not show that landmines allegedly placed by Yerevan specifically targeted Azerbaijanis.
The rulings are part of a wider legal battle between the two former Soviet republics, which fought a short war over the region in 2020.
Since mid-December, a group of Azerbaijanis has blocked the only road into Karabakh from Armenia, called the Lachin corridor, to protest what they claim is illegal mining causing environmental damage.
But the ICJ ordered an end to the blockade.
"Azerbaijan shall, pending the final decision in this case... take all measures at its disposal to ensure unimpeded movement of persons, vehicles and cargo along the Lachin corridor in both directions," presiding judge Joan Donoghue said.
"The disruption on the Lachin Corridor has impeded the transfer of persons of Armenian national and ethnic origin," she said, in a ruling handed down at the court's headquarters in The Hague.
Evidence presented during a court hearing last month showed there have been hindrances to the importation into Nagorno-Karabakh of essential goods, "causing shortages of food, medicine and other life-saving medical supplies," judge Donoghue said.
Therefore the court concluded that there is urgency and that there was "a risk that irreparable prejudice will be caused," the judge said.
'Not placed evidence'
Armenia last month told judges the mountainous region of some 120,000 people has been running short of food, medicines and fuel as a result of the blockade.
It asked the ICJ to order Azerbaijan to stop the blockade and ensure full movement of goods and natural gas into the region, accusing Baku of "ethnic cleansing".
Azerbaijan in return said the allegations were "baseless."
It filed a counter-claim against Armenia before the court, accusing Yerevan of laying landmines and planting booby traps in the region "murdering and maiming Azerbaijanis."
But a majority of the 16-panel of judges ruled that Azerbaijan's claim was not met under the treaty it was brought.
The Convention on the Elimination of All Forms of Racial Discrimination did not impose "any obligation on Armenia to take measures to enable Azerbaijan to undertake demining or to cease and desist from planting landmines," judge Donoghue said.
"Azerbaijan has not placed before the court evidence indicating that Armenia's alleged conduct with respect to landmines" impeded on the rights of Azerbaijanis, she said.
When the Soviet Union collapsed in 1991, ethnic Armenian separatists in Nagorno-Karabakh broke away from Azerbaijan.
The ensuing conflict claimed around 30,000 lives.
Another war between the Caucasus arch foes in 2020 killed more than 6,500 and ended with a Russian-brokered truce that saw Armenia cede territories it had controlled for decades.
But unrest has continued.
Both countries asked the court to take emergency measures as it deals with wider, tit-for-tat cases alleging breaches of an international anti-discrimination convention.
Wednesday's ruling comes after hearings held in late January, but an overall judgment will take years.