The High Court in Hong Kong ordered protesters to clear roads at an illegal assembly site in Mong Kok on Monday.
It is the demonstrators' only remaining protest site in Kowloon, and the area is considered by police to be on the verge of riots.
Justice Jeremy Poon Shiu-chor handed down the ruling, saying the court has to strike a balance on the right to use public streets. He also said the blockade is a public nuisance that is seriously affecting taxi drivers' income.
The order is valid until 10 am on Friday. Printouts of it will be posted on the streets and published in newspapers. Those who wish to protest the ruling have been told to appeal through judicial channels.
The order was sought by taxi and minibus operators, who have suffered losses as a result of the blockades.
A similar order was also granted for streets around the central government offices complex in Admiralty to reopen access for vehicles to a nearby office building.
Protesters have taken to the streets of Hong Kong Island and Kowloon to demonstrate against the method being used to select the city's next leader in 2017.
Hong Kong's Chief Secretary Carrie Lam Cheng Yuet-ngor and four other senior officials will explain the constitutional basis for the city's electoral reform to representatives from the Hong Kong Federation of Students at talks on Tuesday.
Leaders of the illegal assembly in Mong Kok, using a loudspeaker, said they will defy the order. They have described their deliberate breach of the law as a form of "civil disobedience".
Police questioned on Monday whether the protesters are still observing the principle of peace and nonviolence.
On Thursday, an attempt by officers to tear down barricades in Mong Kok failed. The intersection of Nathan Road and Argyle Street has become the scene of clashes between the police and protesters.
After two consecutive nights of violence over the weekend, police narrowly avoided another clash with the protesters on Monday, following negotiation efforts by officers and lawmakers.
Police spokesman Chief Superintendent Steve Hui Chun-tak described the situation in Mong Kok at a news briefing on Monday as " verging on riots".