President Trump said Sunday that he and Russian President Vladimir Putin discussed the creation of a “Cyber Security” unit to prevent future Election Day meddling — a proposal quickly slammed by both sides of the political aisle as dangerous and premature.

Tweeting about his two-hour meeting with Putin at the G-20 summit in Hamburg, Germany, over the weekend Trump said it is time to build a “constructive” relationship with the superpower.

“Putin & I discussed forming an impenetrable Cyber Security unit so that election hacking, & many other negative things will be guarded and safe,” he said.

Three top Republicans, Sens. John McCain (Ariz.), Lindsey Graham (SC) and Marco Rubio (Fla.), scoffed at the proposal.

“It’s not the dumbest idea I have ever heard, but it’s pretty close,” Graham told NBC’s “Meet the Press.”

McCain, chairman of the Armed Services Committee, bristled on CBS’s “Face the Nation” that Putin has gone unchecked for “literally trying to change the outcome . . . of our election.

“Yes, it’s time to move forward,” McCain said, “but there has to be a price to pay.”

“I’m sure that Vladimir Putin could be of enormous assistance in that effort — since he is doing the hacking,” McCain quipped.

Rubio said the idea of a Putin partnership is like asking the fox to guard the henhouse.

“Partnering with Putin on a ‘Cyber Security Unit’ is akin to partnering with [Bashar] Assad on a ‘Chemical Weapons Unit,’ ” Rubio said of the Syrian leader who gassed his own people.

Rep. Adam Schiff (D-Calif.), ranking member of the House intelligence committee investigating Russian interference in the election, said on CNN’s “State of the Union,” “If that’s our best election defense, we might as well just mail our ballot boxes to Moscow.”

But White House Chief of Staff Reince Priebus insisted his boss isn’t letting Putin “off the hook,” and said the president does not believe the Russian party line.

“The president absolutely did not believe the denial of President Putin,” Priebus told “Fox News Sunday.”

Still, he doesn’t want disagreements about the 2016 election to stifle opportunities to work together on a cease-fire in Syria, fighting ISIS and resolving the conflict in Ukraine, Priebus added.

In his morning tweets, Trump touted his G-20 visit as a success, and insisted he was tough on the Russian strongman.

“I strongly pressed President Putin twice about Russian meddling in our election. He vehemently denied it,” Trump tweeted, without saying whether he accepted the denial.

“Now it is time to move forward in working constructively with Russia!” he added.

The US intelligence community and GOP leaders in Congress have concluded Russia interfered in the 2016 presidential election with the intention of harming Hillary Clinton’s chances, but the president appeared unconvinced that Russia is the lone culprit.

At a press conference in Poland on Thursday, Trump said that Russia interfered in the election, but with other countries.

“Nobody really knows for sure,” Trump said, casting doubt on the intelligence community’s assessment.

Priebus on Sunday said Russia meddled but blamed two other countries as additional culprits.

“China has, North Korea has, and they have consistently over many, many years,” Priebus said.

Trump remained skeptical Sunday.

“Questions were asked about why the CIA & FBI had to ask the DNC 13 times for their SERVER, and were rejected, still don’t have it,” Trump tweeted.

The DNC has said it turned over everything that was requested by federal law enforcement, including a carbon copy of its hacked server.

But Trump did appear to acknowledge some Russian hacking occurred — by making an argument that President Barack Obama could have done more.

“Fake News said 17 intel agencies when actually 4 (had to apologize). Why did Obama do NOTHING when he had info before election?” Trump said.

The Obama administration warned in October that Russians were trying to influence the 2016 election, but was hesitant to raise sound alarm bells over concerns of appearing too politically involved in the election. It did, however, impose sanctions after the election.

The Republican-led Senate in June passed legislation to impose more sanctions and limit Trump’s ability to remove them. The bill awaits passage in the House.

Before heading off to hit the links at Trump National Golf Club in Sterling, Va., Sunday, the president signaled that sanctions against Russia should be kept in place, for leverage.

“Sanctions were not discussed at my meeting with President Putin. Nothing will be done until the Ukrainian & Syrian problems are solved!”