An “embarrassed” Ben Affleck admitted on Tuesday that he tried to conceal his slave-owning ancestors from the PBS documentary series “Finding Your Roots” after the disclosure was made earlier this week in hacked Sony emails.

“I felt embarrassed,” Affleck wrote on Facebook. “The very thought left a bad taste in my mouth.”

The Oscar-winner, addressing the issue for the first time, confirmed reports that he asked executive producer Henry “Skip” Gates Jr. to ignore his ancestors’ slave history after the genealogical series made the discovery. Gates is also a professor at Harvard.

“I didn’t want any television show about my family to include a guy who owned slaves,” Affleck explained, adding that the revelation made him feel quite vulnerable.

PBS announced on Tuesday that it was investigating the matter.

The leaked Sony emails, first published by WikiLeaks, show a back-and-forth between Gates and Sony chairman Michael Lynton over whether or not a certain “megastar’s” history should be excluded from the show.

“To do this would be a violation of PBS rules, actually, even for Batman,” Gates wrote. “Once we open the door to censorship, we lose control of the brand.”

Lynton told Gates to get rid of it: “I would take it out if no one knows, but if it gets out that you are editing the material based on this kind of sensitivity then it gets tricky. Again, all things being equal I would definitely take it out.”

The story of Affleck’s slavery roots never aired on PBS. Instead, Gates opted to focus on different ancestors of the “Batman v Superman” star who were “more interesting.”

“Ultimately, I maintain editorial control on all of my projects and, with my producers, decide what will make for the most compelling program,” Gates said in a statement.

Affleck warns that “Finding Your Roots” isn’t your typical “news program” but rather a show for which stars like himself can voluntarily provide historical information.

Anderson Cooper, baseball star Derek Jeter and filmmaker Ken Burns have recently appeared on the PBS docuseries. All three celebrities discovered that their ancestors were slave owners.

Affleck said he hopes that, if anything, the PBS controversy would keep the issue of slavery in the national spotlight.

“We deserve neither credit nor blame for our ancestors,” he wrote, “and the degree of interest in this story suggests that we are, as a nation, still grappling with the terrible legacy of slavery.”

A spokesman for PBS could not be reached for comment.

Read Affleck’s full remarks below:

After an exhaustive search of my ancestry for “Finding Your Roots,” it was discovered that one of my distant relatives was an owner of slaves.

I didn’t want any television show about my family to include a guy who owned slaves. I was embarrassed. The very thought left a bad taste in my mouth.

Skip decided what went into the show. I lobbied him the same way I lobby directors about what takes of mine I think they should use. This is the collaborative creative process. Skip agreed with me on the slave owner but made other choices I disagreed with. In the end, it’s his show and I knew that going in. I’m proud to be his friend and proud to have participated.

It’s important to remember that this isn’t a news program. Finding Your Roots is a show where you voluntarily provide a great deal of information about your family, making you quite vulnerable. The assumption is that they will never be dishonest but they will respect your willingness to participate and not look to include things you think would embarrass your family.

I regret my initial thoughts that the issue of slavery not be included in the story. We deserve neither credit nor blame for our ancestors and the degree of interest in this story suggests that we are, as a nation, still grappling with the terrible legacy of slavery. It is an examination well worth continuing. I am glad that my story, however indirectly, will contribute to that discussion. While I don’t like that the guy is an ancestor, I am happy that aspect of our country’s history is being talked about.

Ben Affleck