After five years, federal investigators have found that the University of North Carolina at Chapel Hill mishandled complaints of campus sexual assaults and thus violated a key gender-discrimination law.

The 2013 complaint that led to the UNC investigation helped spur a national policy debate over rape on college campuses and the federal government's role in regulating investigations of it. And now the institution has agreed to review and possibly change some its policies around Title IX of the Education Amendments of 1972.

In the UNC case, Andrea Pino and Annie Clark, two alumnae who were raped on campus but said that administrators bungled their cases, helped lead a campaign to file the complaint against the institution in 2013. They became national heroes for sexual assault survivors and their supporters, with their story launching waves of Title IX complaints across the country. The women eventually founded an advocacy group, End Rape on Campus, and co-wrote a book.

But their own complaint, more than five years in the making, remained unsettled until this month. The U.S. Department of Education's Office for Civil Rights, after reviewing 387 reports of sexual harassment and sexual violence at the university from 2011 to 2016, concluded that the university was indeed out of compliance with Title IX.

UNC chancellor Carol L. Folt instead released a statement to the campus Tuesday on the university’s resolution agreement with the Education Department -- a tool that OCR has relied on in place of fines or denial of funding. UNC agreed to give notice to students, employees and outsiders about sexual harassment and discrimination policies, and to clarify pieces of its Title IX processes.

The university must prove to the department it has met the OCR requirements and federal officials can come on campus at any time and interview students and staffers to ensure that the university is abiding by the agreement.

“Nothing is more important to us than creating a culture at Carolina where every member of our campus community feels safe, supported and respected,” Folt wrote in her message. “While this concludes the OCR investigation, it does not conclude our commitment.”

Most of the missteps by UNC seemed to happen in the early years that the department investigated, from 2011 to 2013. Investigators noted that the university kept poor records and that administrators weren’t properly trained to handle Title IX cases.

"The university's own records from that time period suggest improper action, or inaction, by university staff at different levels of the complaint process," the department wrote.

From 2014 to 2016, UNC “generally conducted adequate, reliable and impartial investigations of the complaints,” though sometimes it failed to resolve cases quickly, investigators indicated. Of the 18 formal Title IX investigations conducted in those two years, only five were resolved within the correct time frame. The rest lagged, with one case extended to 213 days.

Under the Obama administration, institutions were supposed to finish handling Title IX cases within 60 days. This was part of the guidance that Education Secretary Betsy DeVos rescinded last year on how campuses should handle Title IX cases. While survivor advocates credited the 2011 Dear Colleague letter with improving the investigations and adjudication processes for survivors, critics said the Obama rules were unfairly slanted against accused students, which DeVos agreed with.

DeVos didn't mandate a timeline in her interim rules.

The department did indicate that UNC improved its response to sexual violence over the years, hiring a full-time Title IX coordinator and a deputy, as well as more staffers for investigations and new training programs.

“During the course of its investigation, OCR recognizes the university has been proactive regarding its efforts to maintain a campus environment free from discrimination, harassment and related misconduct, including sexual violence and sexual assault, including through strengthening its Title IX response policies, procedures, resources and outreach,” the department wrote.

Both Pino and Clark said in statements they felt validated by the results of the investigation -- especially on the heels of the Me Too movement and the anniversary of Title IX.

“UNC is certainly not the only school that has swept sexual violence and harassment under the rug; however, our students have learned from a great place of higher education, and because we have the knowledge, privilege, and power to do so, we have and continue to hold the university that we love accountable … We as a society have so much further to go. I want every student to feel safe everywhere, but especially at school -- whether that is in kindergarten or college,” Clark said in her statement.

Initially, part of the OCR findings seemed to contradict the department's temporary rules on how campuses should treat Title IX cases, fueling confusion at a time when institutions are still scrambling to understand their legal obligations. But this was simply a department error.

OCR noted in its investigation that its policy on Title IX for employees did not allow for both parties to appeal, which it said “wasn’t equitable.”

This contradicted the interim Title IX guidance that the department released last year. DeVos said an institution could choose to offer an appeal to only one party: the accused.

Institutions can also pick whether they want appeals for both parties or no appeals at all. Department spokeswoman Liz Hill said that OCR is in the process of correcting its correspondence with the university to let it know its policy is consistent with the department's temporary rules.

But Laura Dunn, a lawyer and founder of the advocacy group SurvJustice, now with the Fierberg National Law Group, said that DeVos's interpretation of Title IX is simply incorrect.

"The UNC decision reflects a properly legal interpretation as well as the contradictory position of the department under the Trump administration and its willful misapplication of civil rights law to favor those accused over the protected class Title IX serves -- victims of sex discrimination including sexual harassment and violence," Dunn wrote in an email.

Brett Sokolow, president of the Association of Title IX Administrators, said inconsistency in Title IX isn’t new, adding that he also thought the department’s resolution with UNC was “both confusing and contradictory.”

Though the department did roll back the Dear Colleague letter from 2011, it did not nix a follow-up letter in 2015, which was based on the 2011 guidance, nor rules instituted under the Bush administration in 2001, Sokolow said.

“OCR field officers used to regularly contradict each other in public presentations on Title IX,” Sokolow wrote in an email. The association “has long had the role of trying to translate OCR intentions to the field, and despite our willingness to do that, it really would be preferable for OCR to offer definitive technical assistance itself.”

Given the cutbacks in OCR, this is unlikely, he said.

The interim guidance was “rushed” and “does not reflect a thoughtful balancing of the needs” of institutions and both survivors and accused students, said S. Daniel Carter, president of Safety Advisors for Educational Campuses, which consults with universities on Title IX.

“This is nowhere more clear than the guidance concerning appeals options for complaints and respondents in Title IX disciplinary procedures,” Carter said in an email. He said that another federal law, the Jeanne Clery Disclosure of Campus Security Policy and Campus Crime Statistics Act, requires equal appeal rights, as well as reporting certain crimes to the government.

“Advising institutions as OCR has that they may limit appeals under Title IX when this is clearly at odds with the Clery Act requirements is likely to cause confusion among institutions,” Carter wrote.

Jim Newberry, a lawyer who heads the higher education practice at Steptoe & Johnson, said it was difficult to reconcile OCR's findings on the appeals process with directions to colleges in the interim guidance released last year.

"It does create more confusion, there's no question about it," he said.

-- Andrew Kreighbaum contributed to this report.