CANBERRA, Australia (AP) — Australia’s prime minister said Friday that he “read the Riot Act” to lawmakers who caused the government to lose votes in Parliament by sneaking out early.

The government lost three votes in the House of Representatives late Thursday because the absence of several government lawmakers gave the opposition Labor Party a majority.

It was a humiliating blow to Prime Minister Malcolm Turnbull’s promise of a stable government in the first week Parliament has met since a July election left his conservative coalition with a single-seat majority.

Turnbull said it was a wakeup call to the lawmakers, including three ministers who left Parliament House early on the final sitting day of the week.

“They know they did the wrong thing. I read the Riot Act to them, their colleagues will all read the Riot Act to them,” Turnbull told Melbourne Radio 3AW.

Australians are used to federal governments with commanding majorities and disliked the uncertainty that surrounded a precarious minority government that was thrown out after three years in 2013.

Parliament ends its week at 5 p.m. on a Thursday, and the adjournment motion is usually a formality that doesn’t require a vote. But Labor took advantage of the government lawmakers leaving early by defeating the motion 69 votes to 67 and forcing the chamber to continue the session for more than two hours.

Labor then won three votes on procedural matters which did not affect government legislation. The adjournment motion was eventually passed.

Turnbull said Labor’s temporary control of the House of Representatives before the absent government lawmakers frantically returned did not mean his government would not be able to survive for its full three-year term.

“There’s no doubt last night was embarrassing, there’s no doubt it was a wakeup call. In fact, in some respects it’s good to have got it in the first week,” Turnbull said.

“I’m very disappointed that members (of Parliament) left when they shouldn’t have left, but it will not happen again,” he said.

Opposition leader Bill Shorten said Turnbull was leading the first majority government to lose a vote in the House of Representatives in 52 years.

“Mr. Turnbull lost complete control of the Parliament,” Shorten told reporters. “Turnbull has no authority over his party.”

Constitutional lawyer Anne Twomey said the opposition could create unprecedented political chaos if it managed to pass through the House a bill that had already been passed by the Senate, where the government is in a minority.

While the government could reverse the vote in the House, it would be unlikely to have enough votes to succeed in the Senate.

Lawmakers who need to leave Parliament early are expected to tell their parties. Their parties then ask their opponents for a “pair” — a lawmaker who agrees to abstain from voting and cancels out the absent lawmaker.

The absent lawmakers have apologized for leaving early without permission.