LONDON — Three hundred years ago, after King James II had suspended Parliament and tried to rule alone, the pendulum of power swung in the British Isles. In the revolution that swept him aside, the monarchy, once supreme, ceded powers to lawmakers, gradually rendering itself an ornament in a system increasingly controlled by Parliament.

But the truce that evolved in the centuries that followed — between the government and monarchy on one side, and Parliament on the other — was threatened last month when Prime Minister Boris Johnson told the queen to send lawmakers home, starving them of precious time to make their own plans before Britain’s exit from the European Union.

So “egregious” was the overreach, a Scottish court said this week, that it did something no British court ever had before: It ruled that the prime minister had misled the public and unlawfully advised the queen on a suspension of Parliament, abusing some of the loftiest powers he had to clear his path of recalcitrant anti-Brexit lawmakers.

The decision triggered a Supreme Court hearing next week, setting up the most serious test in years of a British government’s power. Hanging in the balance is the fate of Mr. Johnson’s leadership, along with the delicate arrangement that has kept the monarch out of politics for so long.