A Federal Court judge has ruled the union regulator’s investigation into the Australian Workers' Union (AWU) donations to GetUp! was invalid, but not political.

Justice Mordecai Bromberg determined the Registered Organisations Commission (ROC) investigation into the donations, which it was pushed to conduct by the LNP, was not politically motivated as the union had argued in a civil trial.

The probe specifically related to a time when former opposition leader Bill Shorten headed the union.

In October 2017, the Australian Federal Police raided AWU offices in Melbourne and Sydney, seizing documents related to the donations.

The raids were filmed by the media after being tipped off by the office of then-jobs minister Michaelia Cash.

The AWU mounted a legal challenge to prevent the documents from being accessed.

Justice Bromberg says further hearings will be needed to determine whether the search warrants were invalid.

Justice Bromberg said ROC executive director Chris Enright decided to conduct the investigation on a “flawed” basis.

He said that if an alleged contravention of union rules had not been acted upon in four years, it was “deemed to have been in compliance” with the rules.

The judge rejected the union’s claims that the ROC investigation happened for an “improper political purpose”.

“I have concluded that the evidence before the court does not establish that the decision made to conduct the investigation was made for the improper purpose contended for by the AWU,” Justice Bromberg said.