HARTFORD, Conn. -- A Connecticut Superior Court judge ruled Thursday that UConn did not violate the state's ban on nepotism when it hired football coach Randy Edsall's son as an assistant coach.

Judge Trial Referee Joseph Shortall on Thursday vacated the state Citizen Ethics Advisory Board's ruling that would have forced Corey Edsall to leave his job when his contract expires in January.

Shortall says Randy Edsall was not yet a state employee when he negotiated for his son to be hired as tight ends coach.

The judge says the board made a mistake by determining that the head coach was hired on Dec. 28, 2016, finding that Edsall wasn't a state employee until Jan. 3, 2017.

"The parties agree that only if Randy Edsall was a 'state employee' on January 1, 2017 was his involvement in setting the terms of Corey's employment a violation of the (ethics statue) i.e. an illegal use of his public position to obtain financial gain for his son," Shortall wrote.

The decision also notes that before Corey Edsall was hired the school had sought and obtained an advisory opinion from the state ethics board outlining conditions for his employment and then followed those to the letter.

"The university appealed the board's ruling because we were confident that UConn carefully followed state statute and well-established management practices in instances such as this," UConn president Susan Herbst said in a statement Thursday. "We are gratified that the judge unambiguously agreed. We look forward to moving on."

The ethics board's ruling led to a change in state law allowing immediate family members to work in the same department within the higher education system under certain conditions.

The ethics board did not immediately return calls and emails Thursday seeking comment.

The elder Edsall is in his second stint as UConn's football coach. His teams have gone 4-16 over the past two seasons, including 1-7 (0-4 American) this season. The Huskies visit Tulsa, which also is 1-7, on Saturday.

Randy Edsall also coached at UConn from 1999 through the 2010 season, going 74-70 and winning the Big East titles in 2007 and 2010 and taking the Huskies to the Fiesta Bowl in his final season.