Trooper Anthony Scott was let go in March after an investigation into an incident last year in Pittsboro.
Scott was at a home there when a real estate agent allegedly choked and pointed a gun at his estranged wife.
According to published reports, Scott and the woman were having an affair.
At the time, The Highway Patrol said Scott was on duty when it allegedly happened, but had not been dispatched to the location and was not there for official business.
The woman's husband, 41-year-old Eric Andrews, was charged with felonious assault by strangulation, felonious second degree kidnapping, assault by pointing a gun, assault on a female, and communicating threats.
In a ruling Tuesday, a judge reinstated Scott, reassigned him to Charlotte, and demoted him from master sergeant to trooper.
The judge said N.C. Crime Control Secretary Reuben Young overstepped his authority by firing Scott - saying it was up to the Highway Patrol commander to make the decision.
The decision now goes to the state personnel office that can either accept it or appeal.