A judge on Friday ordered protesters at the Ambassador Bridge over the U.S.-Canadian border to end the 5-day-old blockade that has disrupted the flow of goods between the two countries and forced the auto industry on both sides to roll back production.

It was not immediately clear when or if law enforcement officers would be sent in to remove the demonstrators, who parked their pickups and other vehicles in a bumper-to-bumper protest against the country’s COVID-19 restrictions and an outpouring of fury toward Prime Minister Justin Trudeau and his Liberal government.

Chief Justice Geoffrey Morawetz of the Ontario Superior Court said during a virtual hearing that the order would be effective at 7 p.m. to give protesters time to leave.

Also read | Convoy protests over anti-vaccine continue in Canada’s Ottawa: What we know so far

Windsor police immediately warned that anyone blocking the streets could be subject to arrest and their vehicles may be seized.

At the bridge, a person, who would not provide his name, grabbed a microphone and addressed the crowd. He asked the protesters if they wanted to stay when 7 p.m. rolled around or leave. By a show of applause, it was agreed they would stay. “OK,”’ the man said. “Let’s stand tall.”

The crowd responded by singing the Canadian national anthem and chanting “freedom.”

Since Monday, drivers mostly in pickup trucks have bottled up the bridge connecting Windsor to Detroit. Hundreds more truckers have paralyzed downtown Ottawa over the past two weeks. And protesters have also blocked two other border crossings, in Alberta and Manitoba.

Also read | In Pics | ‘Freedom Convoy’ protests continue as US urges Canada to act

The judge’s decision came after a 4 1/2-hour court hearing at which the city of Windsor and lawyers for auto parts makers argued that the blockade was causing undue economic harm for the city and region.

Supporters of the protesters, some of them truckers, argued that an order to disband would disrupt their right to peacefully protest vaccine mandates that hinder their ability to earn a living.

The ruling came in a day of fast-moving developments as federal, provincial and local officials worked simultaneously on different fronts to try to break the standoff with the so-called Freedom Convoy, whose members have been cheered on by the right in the U.S., including Fox News personalities, Donald Trump and Texas Sen. Ted Cruz.

“This unlawful activity has to end and it will end,” Trudeau warned just hours earlier.

Also read | Truck blockade at US-Canadian border shuts auto plants

“We heard you. It’s time to go home now,” the prime minister said, cautioning that “everything is on the table” for ending the blockades.

Also Friday, Ontario Premier Doug Ford declared a state of emergency and threatened heavy penalties against those who interfere with the free flow of goods and people.

Ford said he will convene the provincial cabinet on Saturday to urgently enact measures that make it “crystal clear” it is illegal to block critical infrastructure. Violators will face up to a year in prison and a maximum fine of $100,000, he said.

“There will be consequences for these actions, and they will be severe,” Ford said. “This is a pivotal, pivotal moment for our nation.”

Also read | Canadian provinces lift COVID restrictions, protests remain

The measures will also provide additional authority “to consider taking away the personal and commercial licenses of anyone who doesn’t comply,” according to the premier’s office.

Trudeau called Ontario’s decision “responsible and necessary” and said he spoke with U.S. President Joe Biden about it.

“We discussed the American and indeed global influences on the protest,” Trudeau said. “We talked about the U.S.-based flooding of the 911 phone lines in Ottawa, the presence of U.S. citizens in the blockade and the impact of foreign money to fund this illegal activity.”

Trudeau said that on some fundraising platforms, as much as 50% of the donations are coming from the U.S.

Also read | COVID protests threaten border trade between Canada, US

He said he and Biden agreed that “for the security of people and the economy, these blockades can’t continue.”

Trudeau said he understands the protesters are frustrated by the pandemic, but “these blockades are hurting everyday families, auto assembly workers, farmers, truckers, blue-collar Canadians.”

The protests have caused shortages of auto parts that have forced General Motors, Ford, Toyota and Honda to close plants or cancel shifts.

Before the judge’s ruling came down, dozens of protesters in Windsor blocked the entrance to the bridge in what felt like a block party. Demonstrators milled about, carrying signs and Canadian flags — some at the ends of hockey sticks — while music played and food handed out. A trampoline was set up for the children.

Also read | New Zealand COVID-19 protest convoy block streets near parliament

Troy Holman, a 32-year-old Windsor resident who has protested every day this week, said he believes the government overreached with its COVID-19 restrictions, which he said hurt his wife’s small business.

“Unfortunately, we have to be here, because this is what’s going to get the attention of the government,” he said.

Signs read, “Freedom Is Essential,” “Say No to Mandatory Vaccines” and “End Mandates.”

“We stand for freedom. We believe that it should be everyone’s personal decision what they inject into their bodies,” said protester Karen Driedger, 40, of Leamington. “We’re saying, ‘That’s enough.’ We need to go back to normal and live our lives again.”

Authorities at various levels of government have hesitated to forcibly remove the protesters around the country, reflecting apparently a lack of manpower by local police, Canada‘s reverence for free speech, and fears of violence. Windsor Mayor Drew Dilkens warned earlier this week that some of the truckers are “willing to die.”

Also read | Canada pushes back against GOP support for COVID protests

But the political pressure to reopen the bridge appeared to be mounting along with the economic toll.

The Ambassador Bridge is the busiest U.S.-Canadian border crossing, carrying 25% of all trade between the two countries. The standoff comes at a time when the auto industry is already struggling to maintain production in the face of pandemic-induced shortages of computer chips and other supply-chain disruptions.

“American legislators are freaking out, and rightfully so,” said Nelson Wiseman, a political science professor at the University of Toronto. “Pressure is now being exerted by the White House on Trudeau to act more decisively.”

Amid signs that authorities might be prepared to get tough, police in Windsor and Ottawa awaited reinforcements from the Royal Canadian Mounted Police, the federal police force.

Ottawa’s mayor has asked for 1,800 additional police officers, which could nearly double the manpower available to the capital city’s police force.

The protests have spread outside Canada as well. Demonstrators angry over pandemic restrictions drove toward Paris in scattered convoys of camper vans, cars and trucks Friday in an effort to blockade the French capital, despite a police ban.

Also read | Canada Protestors move to crypto crowdfunding platform after GoFundMe ban

And in a bulletin to local and state law enforcement officers, the U.S. Department of Homeland Security warned that truck protests may be in the works in the United States. The agency said the protests could begin in Southern California as early as this weekend and spread to Washington around the State of the Union address in March.

While the Canadian protesters are decrying vaccine mandates for truckers and other COVID-19 restrictions, many of the country’s infection measures, such as mask rules and vaccine passports for getting into restaurants and theaters, are already falling away as the omicron surge levels off.

Pandemic restrictions have been far stricter in Canada than in the U.S., but Canadians have largely supported them. The vast majority of Canadians are vaccinated, and the COVID-19 death rate is one-third that of the United States.