President Donald Trump began his high-profile Europe trip by publicly questioning the US intelligence community’s unanimous conclusion that Russia interfered in the 2016 election. He used a one-one-one meeting with Russian President Vladimir Putin to make clear Moscow wouldn’t be punished for the hack.

Then, on Sunday, Trump capped his time at the G20 summit in Hamburg, Germany, with an announcement that he and Putin had agreed to create “an impenetrable Cyber Security unit so that election hacking, & many other negative things” will be prevented.

Trump, if he sticks with the plan, will be trying to stop election hacking by working with the man who has turned election hacking into an art form.

The announcement stunned lawmakers from both parties, with Republican Sen. Lindsey Graham describing it as “pretty close” to the “dumbest idea I’ve ever heard.” Graham also blasted Trump for his continued refusal to acknowledge the Russian hacking campaign.

“He is literally the only person I know of who doesn’t believe Russia attacked our election in 2016,” Graham said on NBC News’s Meet the Press.

Florida Republican Sen. Marco Rubio went further, taking to Twitter to warn that “partnering with Putin on a ‘Cyber Security Unit’ is akin to partnering with Assad on a "Chemical Weapons Unit.’”

Trump will be trying to stop election hacking by working with the man who has turned election hacking into an art form

With criticism pouring in, Trump tried to slightly distance himself from the idea late Sunday night, with a tweet that said the “fact that President Putin and I discussed a Cyber Security unit doesn't mean I think it can happen. It can't-but a ceasefire can, & did!”

Trump’s quasi-denial aside, there was something genuinely startling about his first announcement. Trump left for the G20 summit with his presidency engulfed in an array of Russia-related scandals, including a criminal investigation into whether his campaign knowingly colluded with Kremlin hackers.

That meant there was one major question hanging over Trump as he prepared for his face-to-face meeting with Putin: whether he would hold the Russian leader accountable for directing what US spies describe as a systematic hacking campaign designed to hurt Hillary Clinton and help him win the White House.

On Sunday, Trump appeared to answer that question with a resounding “no.”

The summit was a win for Putin and a loss for everyone else

Trump’s announcement Sunday was a suitably surreal ending to what had been a suitably surreal trip, one that infuriated traditional US allies like France and Germany, boosted Putin and other European right-wing political figures, and left the US increasingly isolated on the world stage.

The starkest divisions were over free trade and climate change, where European leaders used unusually strong language to condemn Trump for his protectionism and withdrawal from the Paris climate accords.

“Wherever there is no consensus that can be achieved, disagreement has to be made clear,” German Chancellor Angela Merkel said as the summit wound down. “Unfortunately — and I deplore this — the United States of America left the climate agreement.”

She then pointedly noted that “the other 19 members of the G20 feel the Paris agreement is irreversible” — a clear reminder that she and other top world leaders are looking for ways of sidelining Trump and charting a path that no longer includes the US.

Trump didn’t help matters by making a series of confusing and flatly dishonest statements about the 2016 campaign. The most striking was a Friday tweet bizarrely asserting that “everyone” at the summit was “talking about why John Podesta refused to give the DNC server to the FBI and the CIA. Disgraceful!”

Trump managed to jam three lies and factual mistakes into those 140 characters. First, there’s simply no way 19 other world leaders were talking about whether Podesta, Clinton’s campaign manager, could have done more to prevent last year’s election hack. Second, the servers Russia broke into belonged to the Democratic National Committee, not the Clinton campaign, which meant they were out of Podesta’s control. (Podesta’s Gmail account was separately compromised in a phishing attack and the emails were turned over to the Russia-associated WikiLeaks.)

The CIA, meanwhile, is legally prohibited from investigating crimes that take place on American soil, which means the spy agency wouldn’t have sought access to those servers in the first place.

The confusion over Trump’s Podesta rant, though, pales in comparison to the confusion over what, exactly, Trump believes about Russia’s election hacking — and what, if anything, he plans to do about it.

Trump turns to Putin, of all people, stop future election interference

In the aftermath of Trump’s meeting with Putin, the Russian leader said Trump “agreed” with his denials that the Kremlin had interfered with the 2016 election.

“He asked many questions about that,” Putin said of Trump. “I answered those questions as best I could. I think he took note of that and agreed. In any case, it’s better to ask him how he reacted.”

White House Chief of Staff Reince Priebus told Fox News Sunday that Putin was mischaracterizing the meeting and that Trump “absolutely did not believe the denial of President Putin.”

That raises an obvious question: If Trump believes Putin did hack the US elections, why would he agree to work with the Russian leader to try to prevent hacking in the future?

The answer appears to be depressingly clear: Trump simply refuses to accept the American intelligence community’s unanimous conclusions that Russia worked to ensure that he won the presidency.

Trump obliquely confirmed that he doesn’t see Russian hacking as a major problem in a later tweet from Hamburg:

Sanctions were not discussed at my meeting with President Putin. Nothing will be done until the Ukrainian & Syrian problems are solved! — Donald J. Trump (@realDonaldTrump) July 9, 2017

There’s an important thing to notice there: Russia’s election meddling didn’t make the list.