(CNN) As Pete Buttigieg gains traction in a crowded Democratic field , an inflammatory conflict from his early years as mayor of South Bend, Indiana, is set for its next chapter.

The highly contested and litigated controversy hinges on the contents of five tapes of recorded phone conversations inside the South Bend police department and allegations that the tapes contain racist comments made by a group of officers about former Police Chief Darryl Boykins, who is black. According to court documents, copies of the recordings were made at Boykins' request. Few others have heard the recordings, but that might change as a state court is set to weigh in on whether the tapes can be made public.

Buttigieg has made clear throughout the years-long controversy that he has never listened to and doesn't know what is on the tapes in question.

Buttigieg, then months into his first term as mayor in 2012, asked Boykins to resign over the tapes matter as authorities investigated allegations that Boykins threatened subordinates, both state and federal investigations ended without charges. After initially agreeing to step down, Boykins -- who was the city's first ever African American police chief -- rescinded his resignation and vowed to fight it.

That fight -- along with subsequent settlements and lawsuits to get the tapes released publicly -- has dragged on for seven years.

St. Joseph County Superior Court Judge Steven Hostetler is soon slated to decide whether the tapes can be released to the public. The South Bend Common Council -- the city's city council -- subpoenaed the tapes from the city in 2012 after a group of activists and council members grew worried about allegations of racism inside the department. But the city has long resisted the subpoena.

The legal proceedings related to the tapes have been rather convoluted and messy. This included a federal case brought by the city, which was dismissd after a 2017 ruling by a federal appeals court. After that, the legal wrangling moved on to state court. That suit, in which Hostetler will rule, continues on.

Attorneys representing the officers want the tapes to stay secret. Depending on the judge's eventual decision, the case could go to trial or see additional appeals over their release. The judge held a hearing Monday.

Buttigieg, asked by CNN about the case on Tuesday, said he learned a series of lessons from the controversy. He said he had focused on making sure South Bend was complying with federal law -- but noted that wasn't what many people in South Bend were passionate about.

"For a lot of people, this wasn't about the nuances of the Wiretap Act," he said. "This was about whether they could trust their police department."

"In retrospect, I probably placed too much confidence in that chief at the outset and that's obviously a mistake I would not have made again. Also, that was the last time I made the mistake when firing somebody who is a direct report to me, not doing it in person, having a direction conversation about why that was taking place."

Tom Dixon, Boykins' attorney during the matter, said Buttigieg's comment about the former chief was "astounding" because Boykins "was the one who healed the rift" between white and black officers in South Bend.

"That's astounding, but Pete was probably away from South Bend for a long time and probably never had his finger on the pulse of the police department," said Dixon, who noted he was a Republican. "He is flat out wrong."

The allegations

The allegations date back to 2011, when the South Bend Police Department's telephone recording system crashed and had to be restored from a backup. After the restoration, Police Department Communications Director Karen DePaepe listened to some recordings to determine whether data loss had occurred.

DePaepe, while listening to some of the calls, heard comments from Captain of the Investigative Division Brian Young that "she found to be inappropriate," according to a 2015 federal court decision that laid out the facts in the case. The court document also indicates that Young's line was recorded without his knowledge because the officer who previously had his phone number had asked for the line to be logged.

"At that time, no one intended to record Young's line," the document reads.

DePaepe then told Boykins about the recordings and, according to the court, the police chief "decided to continue the recording practice to gather more information before making a decision on what to do."

Seven months later, according to the court document, Young found out his line was being recorded and asked for the recording to stop; nothing was done at that time. Two months later, Boykins asked DePaepe to "give him relevant recordings of Young's line to keep them as evidence," according to the court; the communications official "made five audio cassette tapes for eight recordings that occurred between February 4, 2011, and July 15, 2011."

According to the court, Boykins informed Young and then-Captain Steve Richmond, who was also recorded on the tapes, that he had access to the recordings. Boykins told Richmond he did not consider him a loyal employee and "threatened to demote, discipline or fire him."

According to court documents, a federal investigation into the recordings was initiated. Buttigieg wrote in his pre-campaign memoir, published in 2019, that the investigation came after the recorded officers "﻿complained to federal authorities, who took the issue seriously."

The mayor addresses the tapes case at length in his memoir and writes that his initial decision to reappoint Boykins -- who had been appointed to the position by Buttigieg's predecessor -- when he took office in January 2012 was his "first serious mistake as mayor."

"The chief, believing that some other officers were gunning for his job, allegedly confronted them with tape recordings that could embarrass them if disclosed," Buttigieg writes. "He had access to these tapes because some phone lines in the department were connected to recording equipment used for interviews and investigations, and the officers had been recorded on that equipment without their knowledge."

Buttigieg goes on to write that he learned -- a few weeks into his first term -- that Boykins was under investigation by the FBI for possibly violating the Federal Wiretap Act.

"The content of the tapes had not come up when I was talking with staff or with the chief about the issue," Buttigieg wrote, adding that if the allegations of racist comments on tape were true, "this was explosive, and serious."

The fallout

The outcry from the community to Boykins' resignation in March 2012 was swift and fervent throughout the South Bend community.

Boykins, a day after resigning his post, decided to withdraw his resignation with the backing of a number of South Bend's African American leaders.

Members of the Rainbow PUSH coalition, a group founded by civil right's icon Jesse Jackson, got involved in 2012 and demanded Buttigieg push for a federal investigation into the matter. Butigieg did just that, according to local reports at the time.

"Overwhelming pressure mounted for me to disclose the recordings, especially from the African-American community," Buttigieg wrote in his book. "Protesters picketed my first State of the City address. A group calling itself Citizens United for Better Government formed and appeared in public meetings with custom-made T-shirts reading RELEASE THE TAPES."

He added: "Like everyone else in the community, I wanted to know what was on these recordings. But it was potentially illegal for me to find out, and it was not clear I could even ask, without fear of legal repercussions. As of this writing, I have not heard the recordings, and I still don't know if I, and the public, ever will."

Boykins, in court filings and through his lawyer, has accused Buttigieg of coercing him into resigning under "false pretense."

In response to the outcry, after securing Boykins' resignation, Buttigieg opted to only demote him to captain. The former police chief, in turn, sued the city for racial discrimination

Buttigieg did not relent on DePaepe and his administration fired her outright for her role in recording the officers.

DePaepe then sued the city over wrongful termination.

"She felt how she was treated wasn't fair, which is why she ultimately filed the lawsuit," her attorney in the suit, Scott Duerring, told CNN.

Ultimately, he added, DePaepe -- now working as a secretary -- blamed Buttigieg for her dismissal and what she viewed as unfair treatment. DePaepe did not immediately return a request for comment from CNN.

DePaepe and the city settled the case in 2014, and she was awarded $235,000, according to local reports.

The tapes case -- as it has come to be known -- has cost the city of South Bend upwards of $2 million, local media reported

In addition to the settlement with DePaepe, Buttigieg opted in 2013 to settle with Boykins and the group of officers impacted by the taping. Boykins was awarded $75,000, and the officers received $500,000.

The city said at the time that the settlements with Boykins, the officers and DePaepe did not indicate an admission of wrongdoing on their part.

"Even defending and winning these claims in court carries great legal costs," Buttigieg said at the time . "So even though I'm confident that our administration did the right thing, there is still a big cost financially and in terms of energy and attention to defending and winning these claims in court."

Dixon, Boykins' attorney in that case, said the former chief was "worn out" by the end of the lawsuits, which led to deep tension between Buttigieg and Boykins.

"I think if Mayor Pete apologized to him now, (Boykins) would say, a day late and a dollar short," Dixon said. "He never felt that he did anything wrong."

Dixon said he wasn't surprised that the controversy was now getting more attention.

"It's about time," he said.

The politics

Buttigieg's handling of the tapes case, now that the small city mayor has vaulted into the upper tier of candidates racing for the Democratic nomination in 2020, is under not just a legal microscope, but a political one, too.

And his handling of the matter -- along with the racial overtones of the case -- has raised questions about whether the mayor will struggle with African American voters, a key demographic in the Democratic primary.

"It's absolutely something that colors their [the community's] perception of how responsive he is or how connected he is with communities of color, specifically the African American community," said Regina Williams-Preston, a city councilmember who is a vocal critic of Buttigieg's and is currently running to be the next mayor of South Bend. "There is still that buzz about did they feel it was the right thing to demote Chief Boykins and the handling of that.

Even still, Williams-Preston is unsure of how the issue will play on the national stage now the Buttigieg is running for President.

"It colors the perception of who he is and where his alliance lies or there's some question of are things getting covered up," she said. "I honestly don't know how much that will impact across the country as he is running for national office."

Buttigieg has also -- so far -- struggled to garner the kind of African American support that will likely be needed to win the nomination. Most of his audiences in South Carolina in March were largely white, notable considering the state's Democratic electorate is overwhelmingly black.

On Monday, Buttigieg told a voter in New York that he is aware of the lack of diversity at some of his presidential campaign events and that he was "very intent" on fixing it.

"We are very conscious and very intent on building the most diverse possible base of supporters at every level, from the committee to the people who fill the room that help lift us up," he said. "And we need the feedback that comes from that, we need the support that comes from that. And that's the kind of campaign we want to build."

The lack of diversity was on display at for his announcement on Sunday, too, a fact that was noted by David Axelrod, a Buttigieg friend and someone who has advised the young Democrat around his run.

"Watching the @PeteButtigieg announcement from South Bend. Crowd seems very large, very impressive but also very white-an obstacle he will have to overcome," Axelrod tweeted . "And by obstacle I mean deficiency. He will need to build out his coalition in a very diverse party."

Buttigieg, who was first elected in 2011 and took office in 2012, has not felt a backlash for the tapes at the ballot box locally. The mayor won reelection in 2015 with over 80% of the vote.