TORONTO -- A judge hearing Toronto's legal challenge of the province's decision to cut the size of city council says the case hinges on whether the Ontario government's actions violate the charter rights of voters and candidates running in the fall municipal election.

Ontario Superior Court Justice Edward Belobaba said at the outset of the hearing that while it's clear the provincial government had the ability to pass a law cutting the number of Toronto city councillors from 47 to 25 seats, the powers of a province must not violate the Canadian Charter of Rights and Freedoms.

Belobaba encouraged lawyers representing the city, province and other intervenors to focus on how Bill 5 -- called The Better Local Government Act -- impacts charter rights which protect freedom of expression in their submissions.

"My interest, and I'll be very blunt to you today, is in the argument that is presented by the city," he said. "Whether or not (the charter and) freedom of expression .... has been infringed here because of the decision to go from 47 down to 25."

The legislation, which passed earlier this month, aligns the city's ward map with federal ridings in time for the Oct. 22 municipal election, a move Premier Doug Ford has argued will improve decision-making and save $25 million. It also cancels planned elections for the head of council position in the regional municipalities of Muskoka, Peel, York and Niagara, turning them into appointed roles.

Belobaba said he plans to rule on the case by the second week of September because of the looming municipal election. He also acknowledged that regardless of the decision he makes, he expects the losing party is likely to appeal.

The deadline for candidates to register in the municipal election is Sept. 14.

Lawyers for the City of Toronto argued that reducing the number of councillors in the middle of an election is "discriminatory and arbitrary," and violates the charter.

"There's no precedent like this where a government has interfered mid-stream in an election," Diana Dimmer said. "That simply can't be justified in our democratic society."

The province argues that municipalities are "creatures of the Legislature" and have no recourse when it comes to the powers of the province over their affairs.

Lawyers for the Progressive Conservative government also say that the legal challenges have "no merit" and have asked for the cases to be dismissed and the province awarded costs.

Outside of the courtroom, Rocco Achampong, a lawyer and council candidate who launched the first legal challenge of Bill 5, said he's hopeful the judge will overturn the law.

"We are encouraged by the arguments put forward by the city...by ourselves and the intervenors in this case," he said. "We just want a fair chance at preserving the integrity of the 2018 Toronto and municipal elections in Ontario."

Mayor John Tory called Bill 5 "unacceptable" and said he fully supported the city's legal action.

"I continue to believe that challenging this legislation and the process used to introduce it is the right and responsible thing to do," he said. "I look forward to Justice Belobaba's ruling -- I believe it could set an important precedent."

Toronto city councillor Janet Davis said she was encouraged by the judge's statements, calling the province's intervention in the election "unprecedented".

"I think that the way that arguments have been made and the way that the judge has listened to them gives me some optimism that there may be something happening here that is going to be very important to restore democracy in the City of Toronto," she said.