Environmental activist Robert Kennedy Jr. sent a secret legal memo to then-state Attorney General Eric Schneiderman, urging him to ban ExxonMobil from doing business in New York for allegedly misleading the public for decades about climate change.

The 17-page Jan. 5, 2016, memo obtained by The Post comes under the heading, “Revocation of Exxon Mobil Authority to do Business in New York” and talks about imposing a “corporate death penalty” on the oil giant.

The document, obtained through a legal request by the Competitive Enterprise Institute, came just weeks after the former attorney launched a securities probe on whether ExxonMobil misled investors on the costs of climate change.

Corporations must obtain a certificate of authority to operate in New York if they were incorporated elsewhere.

“Exxon Mobil’s subterfuge amounts to a crime against humanity,” said the document from the Pace Environmental Litigation Clinic, co-founded by Kennedy (right). “By delaying government action for a quarter century, Exxon Mobil has caused massive and predictable environmental damage in New York State.”

ExxonMobil has more than 1,000 gas stations in New York and does $4 billion per year in sales, accounting for 21 percent of the auto- fuels market in the state, according to the memo.

Kennedy confirmed that he helped craft the legal memo and had numerous conversations with Schneiderman about it.

Asked if New York will eventually ban Exxon, Kennedy said, “I hope so.”

The memo likens the campaign against Exxon Mobil to the fight against tobacco companies a generation ago. Exxon Mobil has misled the public about climate change the way tobacco companies lied about the dangers of smoking, the memo argues.

Kennedy and PELC cite a series of cases where the New York attorney general and other state attorneys general took action to ban corporations from operating..

In 1998, then-New York Attorney General Dennis Vacco, a Republican, revoked the charters of two non profit tax-exempt funded by the tobacco industry, the Tobacco Institute and the Council for Tobacco Research for peddling lies about the health effects of smoking.

The memo acknowledges that Exxon Mobil does not have major terminals in New York and does not employ many people as it does in Gulf states Texas and Louisiana, but revoking its license would be a “psychological shock” to the Petro behemoth.

State Republican Party chairman Ed Cox dismissed Kennedy’s anti-Exxon Mobil campaign as “utterly ridiculous.”

“Bobby Kennedy represents a mindset that destroys jobs and the economy in the United States,” Cox said.

Cox said Kennedy’s extreme views have already damaged New York by successfully pressuring Gov. Cuomo, his ex-brother in law, to ban fracking for cleaner natural gas in New York, which would produce less carbon than coal while generating jobs.

Data from the federal government reveal that U.S. has reduced carbon emissions 14 percent since 2005, and the reductions are mainly attributable to increased cleaner natural gas use for electricity generation rather than other dirtier fossil fuels — oil or coal.

A spokeswoman for current Attorney General Barbara Underwood, said, “our fraud investigation remains ongoing” but had no comment on the Kennedy memo.

Exxon had no immediate comment.

A federal judge in March dismissed Exxon Mobil’s lawsuit against the attorney general’s office in a bid to shut down its investigation.