CBS has been on the defensive this week as it deals with a simmering controversy surrounding the departures of two Asian-American actors from its police procedural show, “Hawaii Five-0.”

The two stars, Daniel Dae Kim and Grace Park, decided to leave the show after they were unable to agree to terms on new contracts — prompting speculation that they left because they would not be earning as much as their white co-stars.

Today, for the second time in less than 24 hours, CBS and producers of the show were saying that they did everything they could to keep them. Peter Lenkov, an executive producer of “Hawaii Five-0,” said that CBS “was extremely generous and proactive in their renegotiation talks.”

“So much so, the actors were getting unprecedented raises, but in the end they chose to move on,” he said in a statement.

A swell of criticism of CBS grew on Wednesday after Kim wrote in a Facebook post that he had made a “difficult decision” to walk out of negotiations and leave the show after seven seasons.

Kim stopped short of saying that unequal pay had been the reason for his departure, but suggested as much in the post, writing, “The path to equality is rarely easy.”

In a statement shortly afterward, CBS said that both cast members “have been important and valued members” of the show and said that they had been offered hefty raises.

“We did not want to lose them and tried very hard to keep them with offers for large and significant salary increases,” the network said. “While we could not reach an agreement, we part ways with tremendous respect for their talents on screen, as well as their roles as ambassadors for the show off screen, and with hopes to work with them again in the near future.”

A representative for Kim and Park declined to comment.

The departures have some advocacy groups crying foul, citing long-standing difficulties for Asian-American actors, who say they often have trouble finding steady work or commanding salaries equal to those of their white counterparts.

“Unfortunately, the racial hierarchy established in the original 1968-1980 series remained intact in the 2010 reboot: Two white stars on top, two Asian/Pacific Islander stars on bottom,” said Guy Aoki, the founding president of the Media Action Network for Asian-Americans, who also criticized the network for not including more actors of Asian or Pacific Islander descent in the show’s cast.

George Takei, an actor of Japanese descent who has made appearances on both the revived “Hawaii Five-0” and the original series, noted that Hawaii is home to a large Asian-American population and called CBS’ inability to get a deal done with the two actors “sad.”

“It’s very unfortunate that CBS couldn’t recognize their value to the show that’s set in Hawaii,” he said in a telephone interview.

Other Asian-American performers said that Kim and Park’s departures would give visibility to diversity and equal pay issues in Hollywood.

The “Fresh Off the Boat” actress Constance Wu wrote on Twitter, “Know ur worth, ur value… & don’t be afraid to stand up for it.” Ally Maki, an actress who stars on TBS’ “Wrecked,” tweeted, “It’s time to stop being silent. This is a great start.”

CBS has faced criticism over a lack of racial diversity in its shows in recent years. In 2016, the network came under fire for promoting a slate of new shows starring white men, including Kevin James in “Kevin Can Wait” and Matt LeBlanc in “Man With a Plan.” In October, CBS announced that it was creating a program to increase diversity in its casting.