TORONTO - A judge has quashed a wrongful dismissal lawsuit by Ontario's former ombudsman against the legislature and his former office.

Andre Marin was not reappointed in 2015 after serving two five-year terms and alleged in a lawsuit that he was fired without cause and without notice - he said a two-year notice period would have been “reasonable.”

He alleged that Premier Kathleen Wynne and the Liberals “orchestrated” his removal from public office because he was so critical of them.

The legislature asked the Ontario Superior Court to dismiss the suit against it due to lack of jurisdiction, and the ombudsman's office asked the court to strike Marin's statement of claim because there was “no reasonable cause of action.”

Judge Peter Cavanagh agreed on both counts in a ruling dated Wednesday and left the issue of how much Marin should pay for legal costs up to the parties to decide.

When contacted by The Canadian Press, Marin said he had no comment because he had not yet read the decision.

Attorney General Yasir Naqvi said in a statement that the all-party process of appointing the new ombudsman, Paul Dube, was a “fair and impartial one.”

“The hiring committee was made up of all three parties where no party had a majority,” Naqvi wrote. “We had over 60 applications for the position and all were given a fair opportunity.”

As Marin's second term was set to expire, he waged a Twitter campaign, warning the public that they would soon have no ombudsman and urging his followers to “make some noise.”

The legislature voted to keep Marin as ombudsman as the selection process continued. Marin's deputy was then appointed on an interim basis and ultimately Dube, the former federal taxpayers' ombudsman, was appointed in early 2016.

Because Marin believed he would be getting a third term he failed to secure other employment, spent money he otherwise would not have on a new home he is building, and suffered public humiliation, he alleged in the suit.

Marin was highly critical of former premier Dalton McGuinty's government over mass arrests and detentions during the G20 summit. He was also outspoken over the Wynne government's partial privatization of Hydro One, in particular the move to remove legislative oversight, calling the new position of an in-house watchdog for the utility an “ombuds-weenie.”

Marin originally also sued the Ontario government, but that claim was withdrawn last year.