The long-running drama between Papa John’s and its beleaguered founder, John Schnatter, has finally reached a resolution. The 5,000-plus unit pizza chain and Schnatter agreed to a separation plan, according to a securities filing Tuesday, where Schnatter will leave the company’s board in exchange for having a say in naming his replacement.

No candidates have been put forward yet, but the settlement calls for Schnatter and new executive chairman Jeffrey Smith to agree on an independent director to serve in his place.

READ MORE: Papa John’s faces an uphill battle in 2019.

In addition, it helps resolve two legal disputes between Schnatter and Papa John’s. The chain agreed to give him all the books and records pertaining to his ouster as chairman last July. Schnatter resigned following a report he used a racial slur in a May conference call arranged between Papa John’s executives and then-marketing agency Laundry Service. A Delaware Chancery Court judge in January ruled Schnatter should be able to review the documents, with some limitations.

Schnatter also agreed to dismiss a separate lawsuit he filed seeking to invalidate a provision of the “poison pill” plan the company adopted in July. Schnatter called it a “Wolfpack” provision in October, adding in a letter, “this provision goes far beyond Delaware law by unreasonably curtailing the rights and legitimate interests of shareholders. Among other things, it precludes shareholders from holding any substantive discussions about the company because of the threat of crippling dilution of their ownership interest in the company.”

Papa John’s issued a statement following the letter: “The independent directors of the Papa John’s Board continue to believe the Rights Plan is in the best interests of the company and all Papa John’s stockholders,” the statement said. “As detailed when it was adopted, the Rights Plan does not prevent the Board from considering any offer that it considers to be in the best interest of Papa John’s stockholders. The plan also reduces the likelihood that any person or group gains control of Papa John’s without paying an appropriate control premium to all of the company’s stockholders.”

With Tuesday’s agreement, Papa John’s agreed to drop a provision in the securities purchase deal with Starboard that required the investor to vote in favor of the company’s incumbent board members when they stand for re-election.

Starboard invested $200 million in Papa John’s in late January. The company, known in the industry for its turnaround efforts at Darden, added two members to the chain’s board, CEO Smith, and Anthony Sanfilippo, the former chairman and CEO of Pinnacle Entertainment.

“I’m happy that we were able to enter into this agreement and allow the new leadership being implemented by Jeff Smith and Starboard to help Papa John’s regain its strength and market position,” Schnatter said in a statement, per The Wall Street Journal.

The incident that triggered Schnatter’s departure as chairman was reported by Forbes, which said the call was designed as a role-playing exercise for Schnatter in an effort to prevent future public-relations snafus. According to the article, he “used the N-word” when asked how he would distance himself from racist groups online. Schnatter allegedly responded: “Colonel Sanders called blacks [racial slur],” and then complained about Sanders not facing the same kind of public outcry. This was in reference to the earlier NFL-related controversy that many credited for Schnatter’s removal as CEO. In December, Papa John’s announced that Schnatter, who founded Papa John’s in 1984, would shift to a role as chairman of the company and COO Steve Ritchie, a longtime employee with the company who started in 1996, was stepping in.

By August, Schnatter was firing back at the company, saying his resignation was a mistake. “The board asked me to step down as chairman without apparently doing any investigation. … I have checked with corporate governance experts who tell me that this was not a proper action by the board.”

Schnatter would go on to question Papa John’s executives, strategy, and everything in between, even accusing its of “serious misconduct at the top levels of our leadership team.” This included direct attacks on current CEO Steve Ritchie, who Schnatter said he told the board in June “needed to go.”

Papa John’s removed Schnatter from its marketing and said later, “John Schnatter is promoting his self-interest at the expense of all others in an attempt to regain control. John Schnatter is harming the company, not helping it, as evidenced by the negative impact his comments and actions have had on our business and that of our franchisees.”

Schnatter remains Papa John’s largest shareholder with roughly a 31 percent stake.

Papa John’s reported its first annual sales decline since 2009 in Q1, with figures dropping 12 percent to $1.57 billion. Papa John’s reported a fourth-quarter loss of $13.8 million, although it ended the year with a small profit. It recorded net income of $4.6 million when adjusted to take out one-time costs, down from $23 million in the prior year.

Q4 revenue dropped 20 percent to $374 million and North America same-store sales fell 8.1 percent, year-over-year. They declined 7.3 percent for the full 2018 calendar versus the comparable period.

In addition, the company tallied up $50.7 million in charges for 2018 as it battled controversy and tried to slow domestic closings, including $15.4 million in financial assistance to franchisees; $19.5 million in legal and advisory costs; and $10 million in marketing contributions.

Papa John’s closed 186 North America franchises and seven corporate stores, shuttering a total of 193 units while opening 89. It acquired another 62 as well to end the year with 3,337 North America restaurants (2,692 franchised and 645 corporate). There are 1,966 international locations.

Finance, Story, Papa Johns