Former talk-show host Tavis Smiley and PBS squared off Tuesday in a D.C. courtroom, with each side arguing that the other was in breach of contract when the network stopped airing his show in 2017 after women who worked for Smiley accused him of sexual harassment.

Female employees had accused Smiley of making inappropriate sexual comments or lewd jokes and commenting on women’s physical attributes. They contend he threatened the career of any woman who complained or tried to end a relationship with him.

Smiley, 55, has repeatedly denied the accusations and argued that PBS broke their agreement when they ended his contract in 2017 without obtaining proof of such allegations.

“PBS failed to keep their promise and did this man wrong. That is what the evidence is going to show,” Smiley’s attorney Ronald S. Sullivan Jr. told jurors as Smiley sat at the table behind him.

PBS attorney Grace Speights told the jury that Smiley repeatedly violated his contract and mistreated women who worked for him.

“This case is about trust and broken promises,” Speights said. “PBS trusted Mr. Smiley, and that trust turned out to be misplaced.”

The harassment allegations were brought by employees of Smiley’s company, TS Media. The case is being heard in D.C. Superior Court because the company, while based in Los Angeles, is incorporated in the District.

During what is expected to be a two-week trial in front of Judge Yvonne Williams, PBS attorneys said they plan to call four of the women to testify. They will be identified only by their first names.

TS Media produced Smiley’s late-night talk show that aired weekdays on PBS stations for 14 years.

Both sides agreed that Smiley’s contract was terminated as a result of PBS’s determination that Smiley had violated a morals clause, which stipulated that personalities such as Smiley are not to do anything that would publicly tarnish the image of the network or a station.

Sullivan told jurors during his opening statement that Smiley, being a “single man who has spent 30 years in the TV business” has had “consensual” relationships with women with whom he worked.

Standing behind his client with his hands on Smiley’s shoulders, Sullivan turned to the jury. “Look at him. Any suggestion that this man would be involved in harassing women would be ludicrous,” Sullivan said.

But Speights, armed with ­poster-size boards covered with dates, argued that Smiley knew PBS did not permit supervisors to have romantic relationships with employees when he signed his final contract for the 2017 season. It was a short time later, she said, that PBS discovered that Smiley had been in a relationship for over a year with a female employee.

Smiley, Speights said, withheld information about that relationship because he knew “a relationship between a manager and a subordinate would reflect unfavorably on himself at PBS.”

Speights said that around that time, during the height of the #MeToo movement, the allegations by other employees began to surface.

PBS had just terminated former talk-show host Charlie Rose after news in The Washington Post surfaced of multiple women accusing Rose of sexual harassment, Speights said.

Speights told the jury that a woman called PBS and accused Smiley of sexually harassing her and suggested other women were victims as well. PBS then began an internal investigation and then suspended Smiley’s show in December 2017.

For weeks, Speights said, Smiley refused to cooperate with the internal PBS investigation. She said that he eventually agreed to cooperate but insisted that he first be provided the names of any woman who spoke to PBS about the allegations.

Speights said Smiley asked for the identities because he had required all of his employees to sign nondisclosure agreements when they were hired, and PBS believed he planned to seek legal action against them for speaking out.

In addition to airing the talk show on its stations around the nation, PBS also contributed about $1 million a year to help Smiley produce his show. PBS contends that Smiley owes the network about $650,000 that it had paid him before the contract was ended.

Smiley took the stand late Tuesday and spent about an hour discussing his life’s journey from his failed Los Angeles City Council seat bid to his life as a TV and radio commentator in Los Angeles. Smiley spoke of how President Bill Clinton, during Smiley’s visit at the White House, introduced him to former nationally syndicated talk-show host Tom Joyner, who then put him on air in 1996. He went on to have a show on Black Entertainment Television.

Smiley then began his own radio show on NPR in 2001, which then led to the TV show on PBS, which he said relied heavily on contributions.

“I often ran my company on a shoestring and a prayer,” Smiley said. At one point, his company employed as many as 40 people. Smiley also regularly recited Bible verses when his attorney asked about his company.

“Where there is no vision, the people perish,” Smiley said. “We struggled to raise money but I was determined to have a show that provided an outlet for diverse guests to give diverse opinions that you weren’t seeing on other talk shows.”

Smiley is suing PBS for breach of contract regarding the termination. PBS is countersuing, claiming Smiley violated the moral clause of the contract and is seeking Smiley to return money the network paid him for that final contract.

Smiley is expected to continue testifying Wednesday.