President Donald Trump attempted to block a merger of AT&T and Time Warner in 2017, according to The New Yorker.

The magazine said Trump told Gary Cohn, then the National Economic Council chief, to "intervene" in the deal.

It cited Trump's longtime opposition to CNN, owned by Time Warner, as a reason for his directive.

The article, which deals with Trump's closeness to Fox News, also suggested he wanted to undermine the AT&T-Time Warner deal to reward Fox, a media ally of his.

President Donald Trump attempted to block a merger of AT&T and Time Warner to spite CNN, according to an explosive new profile of the White House's tangled relationship with Fox News.

The report, published on Monday by The New Yorker, said that in an Oval Office meeting in the summer of 2017, Trump told Gary Cohn, then the director of the National Economic Council, to "intervene" in the deal between AT&T and Time Warner, which owns CNN, among other media brands.

The publication cited an unnamed source as saying that Trump told John Kelly, then his newly appointed chief of staff: "I've been telling Cohn to get this lawsuit filed and nothing's happened! I've mentioned it fifty times. And nothing's happened. I want to make sure it's filed. I want that deal blocked!"

The New Yorker's Jane Mayer said Cohn, a former Goldman Sachs president, "understood that it would be highly improper" for the president "to undermine two of the most powerful companies" in the US "as a reward for a competing news organization that boosted him."

Mayer said Rupert Murdoch, the owner of Fox News' parent company, News Corp, opposed the Time Warner-AT&T merger as "a matter of shrewd business." Trump "also opposed the deal," she continued, "but many people suspected that his objection was a matter of petty retaliation against CNN."

The source told The New Yorker that Cohn walked out of the meeting and told Kelly: "Don't you f---ing dare call the Justice Department. We are not going to do business that way."

A federal judge last June approved AT&T's $85 billion merger with Time Warner.

The White House did not immediately respond to Business Insider's request for comment.