Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Apple Chief Executive Tim Cook on Wednesday slammed Facebook for profiting from its users' data — and called for the social media giant to be more tightly regulated.

Such detailed profiles of people, with "incredibly deep personal information that is patched together from several sources" like Facebook has compiled, shouldn't be allowed to exist, Cook said.

"I think the best regulation is no regulation, is self-regulation," Cook said. "However, I think we’re beyond that here, and I do think that it's time for a set of people to think deeply about what can be done here."

Cook's comments come as Facebook and its chief executive, Mark Zuckerberg, face criticism, lawsuits and political inquiries over how Cambridge Analytica, a data analysis firm that worked with President Donald Trump's election campaign, was able to acquire the user data of 50 million Facebook users.

Speaking at a town hall event hosted by MSNBC's Chris Hayes and Recode's Kara Swisher, Cook said Facebook put profits above all else when it allegedly allowed user data to be taken through connected apps. The event is part of MSNBC's "Revolution" series.

When asked what he would do if he were in Zuckerberg's position, Cook replied: "What would I do? I wouldn't be in this situation."

Byers Market Newsletter Get breaking news and insider analysis on the rapidly changing world of media and technology right to your inbox. This site is protected by recaptcha

"The truth is we could make a ton of money if we monetized our customer, if our customer was our product," Cook said. "We’ve elected not to do that."

"The truth is we could make a ton of money if we monetized our customer, if our customer was our product," Cook said. "We’ve elected not to do that."

"Privacy to us is a human right. It's a civil liberty, and something that is unique to America. This is like freedom of speech and freedom of the press," Cook said. "Privacy is right up there with that for us."

His comments are consistent with Apple's long-held privacy stance — which the company stood by even in the face of a legal quarrel with the U.S. government a couple of years ago, when it refused to help the FBI unlock an iPhone belonging to the man responsible for killing 14 people in San Bernadino, California, in December 2015. Federal officials ultimately backed down, but only because they managed to unlock the phone themselves.

"If that same circumstance arose again, we would fight, because this, again, is a value of America," Cook said Wednesday. "You should not be able to compel somebody to write something that is bad for civilization."

MSNBC's Chris Hayes and Recode's Kara Swisher talk with Apple CEO Tim Cook at the Revolution: Apple Changing the World town hall in Chicago on March 28, 2018. MSNBC

The wide-ranging discussion touched on everything from Apple's latest classroom products and efforts to improve education — Cook urged everyone of all ages to learn how to code to survive the changing jobs market — to politics, to other tech titans.

In regards to Amazon's highly publicized competition for "HQ2," its second headquarters in a yet-to-be-determined location, Cook said that Apple would also be bringing more jobs to places around the U.S. — but, he quipped, "We’re not doing a beauty contest thing. That’s not Apple."

He also spoke passionately about the Deferred Action for Childhood Arrivals, or DACA, program, which President Donald Trump is pushing to phase out. The Obama-era program shields "Dreamers," hundreds of thousands of undocumented immigrants who entered the country as children, from being deported.

"I don’t see this as a partisan issue. This is not about whether you’re red or blue, conservative or liberal. This is about America, right? This is that simple. And so I’m very disappointed with both parties that they have not acted," Cook, who has discussed DACA with Trump, said.

"I'm personally lobbying on this," he said.

Later, when asked by an audience member what advice he would have given to his high school self, Cook said, "The truth is we all have the same purpose, and so we should all quit looking. Our purpose is to serve humanity."

He added: "I wish I had realized that sooner."

The full "Revolution" interview will air Friday, April 6 at 8 p.m. ET, 5 p.m. PT on MSNBC.