Britain's Prime Minister Boris Johnson visits Pimlico Primary school in London, Tuesday July 10, 2018, with Education Secretary Gavin Williamson to meet staff and students. (Toby Melville/Pool via AP)
Britain's Prime Minister Boris Johnson visits Pimlico Primary school in London, July 10, 2018, with Education Secretary Gavin Williamson to meet staff and students.

A Scottish court ruled Wednesday that British Prime Minister Boris Johnson's move to suspend parliament was unlawful.

The judges did not order the suspension overturned, but rather said the matter needs to be decided by Britain's Supreme Court.

The government objected to the court's ruling and said it would file an appeal.

A five-week suspension of parliament went into effect Tuesday.

Opposition lawmakers have strongly objected to what they have called a "coup" by Johnson as Britain faces an October 31 deadline to leave the European Union.

Johnson has pledged to carry out Brexit with or without a deal defining the terms of the split, and said that when the suspension of parliament is over there would be enough time for lawmakers to approve any new divorce agreement he is able to reach with the European Union.

Members of parliament passed legislation last week seeking to force Johnson to ask EU leaders for an extension if no agreement is reached in hopes of averting what they see as disastrous effects of a so-called no-deal Brexit.

Britain on Election Footing as Crisis Pits Parliament v Prime Minister video player.
WATCH: Britain on Election Footing as Crisis Pits Parliament vs. Prime Minister

Johnson's predecessor, Theresa May, failed to get parliament to approve an agreement her negotiators reached with the European Union, and EU officials have expressed little desire to renegotiate.