The Libertad - a three-masted sailing vessel - has been docked at the port of Tema east of Accra since October 2, under a Ghanaian court order requested by NML Capital, a Cayman Islands investment firm that says Argentina owes it $370 million.
On Saturday, the International Tribunal for the Law of the Sea asked "the Ghana authorities to immediately free the Libertad frigate and arrange for her to leave Tema", tribunal head Shunji Yanai said.
Ghana's Deputy Attorney General Ebo Barton-Odro declined to comment until he had reviewed a report from government representatives at the tribunal, and he did not say if Accra intended to honour the request to release the ship.
Though Argentina rescheduled and refinanced much of its debt following an economic crisis and massive default a decade ago, bonds held by speculative funds such as NML are among its unsettled business.
Government officials in Argentina, as well as ruling and opposition party politicians, welcomed the tribunal ruling.
"Argentina will continue to defend itself from financial pirates. Vultures will not prevail," Economy Minister Hernan Lorenzino wrote on his Twitter account.
The government of President Cristina Kirchner contends that Ghana "violated the norms of international law that confer immunity on ships of war."
The Argentine navy uses the Libertad as a training ship.
The captain and a 44-member skeleton crew remain aboard the ship, while 280 other crew members returned to Argentina in late October.
Yanai read out the decision of the 20 judges who attended the hearings of November 29-30.
Ghana had asked for Argentina's complaint to be dismissed and for Buenos Aires to pay the tribunal costs, arguing the court was not competent because the matter is a private trade dispute.
According to Accra, the crew was not at risk and the inconvenience for Argentina was minor.
"Ghana asks that the Argentinian demand be rejected ... It would not be the first time that your tribunal dismisses preventative measures," said Ebenezer Appreku, legal advisor in the Ghanaian foreign ministry.
In Accra on Saturday, there was no indication the sailors on board the Libertad were following developments in the Hamburg court.
A few were seen milling around on the ship, refuelling their generator and receiving a food delivery. There was no discernible reaction to the ruling in Argentina's favour.
Story continues below…
The standoff over the Libertad heated up in early November when the ship's crew brandished guns to stop Ghanaian port authorities from relocating it to a new berth.
Tema Port officials had tried to move the ship over a court order to clear space for commercial activity, but the sailors' resistance forced officials to scrap the plan.
Lawyers acting for Buenos Aires argued that moving the Libertad could prove dangerous as the vessel lacked manpower after more than 280 crew members were evacuated in October.
Argentina also argues that Ghana is barred from boarding the ship under international maritime law and that the ship is protected by immunity under a 1982 UN convention.