A state judge Wednesday evening immediately blocked Texas from taking over the Houston Independent School District until she issues a final ruling on the case, complicating the state's plan to oust the district's school board by March.

In doing so, Travis County District Judge Catherine Mauzy preliminarily sided with Houston ISD, the state's largest school district, in a legal battle that will ultimately determine whether Texas can indefinitely seize power from its elected school board.

Calling the injunction a temporary setback, the Texas Education Agency vowed in a statement to appeal the ruling.

“Any time you are taking on a powerful and entrenched bureaucracy, the road to meaningful change is long and arduous, but when the futures of our children are at stake, we will stop at nothing to make sure they are properly provided for,” the agency’s statement said.

At a hearing Tuesday morning, lawyers for Houston ISD argued that Texas Education Commissioner Mike Morath exceeded his authority in nearly every step in the process of deciding on a takeover.

The state's lawyers said Morath has broad, indisputable authority to seat a board of managers to govern the district, granted under state law. In early November, Morath announced his plans to oust the elected board and appoint a superintendent, citing the longstanding academic failure of Wheatley High School and the school board's alleged violations of state law.

A federal judge in Austin last month dismissed the case, which had dragged on for months, and sent it back down to state district court. The temporary injunction stops Morath from seating a board or imposing any other sanctions until Mauzy rules on the merits of Houston ISD's lawsuit challenging the takeover.

Mauzy also denied Morath the ability to strike down the injunction on appeal. The trial is set for the morning of June 22, months after the state intended to seat a board of managers.

In the ruling, she said Houston ISD proved it needed the injunction because once Morath takes action to remove power from the elected board, the district would then have no recourse.

At Tuesday's court hearing, Houston ISD's lawyers challenged Morath's reasons for the planned takeover, accusing him of inaccurately interpreting state law and skipping procedural steps to get the results he wanted.

"They don't get to ignore the law and take over the district just because they think [the TEA] could do a better job," said lawyer David Campbell.

In an especially tense moment, his colleague Kevin O'Hanlon cross-examined Jeff Cottrill, the TEA's deputy commissioner of governance and accountability, on the technicalities of state law on district takeovers — as the state's lawyer Emily Ardolino repeatedly objected to his line of questioning and was consistently overruled.

Ardolino said the district was grasping at straws and could not prove Morath exceeded his authority. Even if Houston ISD disagrees with Morath's decisions, she said, the lawsuit's claims are "about whether he has the legal authority to do them."

She argued that even Houston ISD's school board members have doubted their ability to govern. She played a video clip of a Houston ISD board member chastising her peers after they secretly decided to vote in a new superintendent without her knowledge at a board meeting in October 2018.

"We are bad for kids as a body," Sue Deigaard said on screen as the judge and lawyers in the courtroom watched silently.

Deigaard was in the back of the courtroom, and Houston ISD lawyers noted her presence to show that the board had since moved beyond the dysfunction of that meeting. She declined to talk to The Texas Tribune about how the state's lawyers used the recording of her commentary.

Mauzy hinted at her decision just before she stood to leave the courtroom Tuesday afternoon.

"Democracy is not always pretty," she said. "But I am convinced it's the best system we have. If we applied some of [the state's arguments] to the Texas Legislature, I don't know where we'd be."