Nigerian labour unions representing millions of workers have been blocked from staging a general strike in protest against government plans to increase petrol prices by up to 67 percent.
The unions announced last week that they would hold an indefinite strike from Wednesday unless the government reversed its decision to scrap a costly fuel subsidy scheme and raise gasoline prices to help it to tackle Nigeria's worst economic crisis in decades.
Ministers hope the move will help to fund fuel imports needed because Nigeria's refineries have been neglected for years.
A fall in oil prices has eaten into the foreign reserves of Nigeria, which relies on crude sales for around 70 percent of national income, with the central bank adopting fixed exchange rate to protect further depletion of reserves.
On Tuesday, the vice president said President Muhammadu Buhari was "left with no choice" but to raise prices. "What can we do if we don't have foreign currency? We have to import fuel," said Yemi Osinbajo.
He made his comments as the Nigerian Industrial Court ruled that the Nigeria Labour Congress and the Trade Union Congress, which represent workers from the public and private sectors, could not proceed with the industrial action.
"The defendants are hereby restrained from carrying out the threat contained in their communique," Justice Babatunde Adejumo said in his ruling on Tuesday, citing the risk of civil disorder and people going hungry.
Nigeria tried to end fuel subsidies in 2012, doubling the price of gasoline overnight, but later reinstated some of the subsidy to end a wave of protest strikes held in defiance of another court ruling.
Talks between the unions and government officials aimed at averting industrial action were scheduled to take place on Tuesday.
The Nigeria Labour Congress and the Trade Union Congress could not be reached for immediate comment on whether they would obey the latest court order or if the talks would go ahead.