(Reuters) - Papa John’s founder John Schnatter is leaving its board of directors as part of a settlement resolving a bitter dispute for control of the world’s third-largest pizza chain.

The company said in a regulatory filing on Tuesday it would co-operate with Schnatter to find a mutually acceptable independent director who would not be affiliated with Schnatter or hedge fund investor Starboard Value LP, which owns a nearly 10 percent stake in the restaurant chain.

Schnatter, who owns about 30 percent of the company’s shares, would resign from the board if the independent director is appointed before the annual stockholder meeting slated for May, Papa John’s said. Schnatter stepped down as chairman last summer, following reports he had used a racial slur on a media training conference call.

Schnatter has filed several lawsuits against the company in a bid to regain control of the company he founded in his father’s tavern. In January, he claimed a victory when a court ordered the board to give him some internal documents, including text messages related to his firing, which Papa John’s had until then refused to share.

After learning that Papa John’s would not nominate him to its board this year, Schnatter last Friday submitted a letter nominating himself, according to a regulatory filing and a person familiar with the matter. The moves laid the groundwork for a costly and distracting proxy battle that the settlement now helps avoid, the person said.

As part of the agreement, Papa John’s has agreed to share with Schnatter all of the company’s records, giving him the option to sue if those documents revealed wrongdoing by the company, Schnatter said in a statement

Schnatter, in return, has agreed to dismiss lawsuits he filed against the company.

“(I am) thankful that I’ve been able to resolve these important issues, and that we can all focus on the company’s business without the need for additional litigation,” Schnatter said.

The restaurant chain agreed to remove a provision of a poison pill, a stockholder rights plan that can dilute shares, preventing Schnatter from speaking with other shareholders about the company.

Papa John’s also agreed to relinquish the requirement that Starboard vote in favor of the incumbent board.

Last week the pizza chain said its North American same-restaurant sales fell 7.3 percent in 2018 and that sales would lag into the first half of 2019.

Its shares were up about 3 percent in morning trade on Tuesday.