"Putin & I discussed forming an impenetrable Cyber Security unit so that election hacking, & many other negative things, will be guarded and safe," he said following their talks at the G-20 summit in Hamburg, Germany.

Tweeting after his first meeting with Putin on Saturday, Trump said now was the time to work constructively with Moscow.

U.S. President Donald Trump said in a tweet on Sunday that he discussed forming a cyber security unit to guard against election hacking with Russian President Vladimir Putin.

President Donald Trump speaks with Russian President Vladimir Putin during the their bilateral meeting at the G20 summit in Hamburg, Germany July 7, 2017.

U.S. President Donald Trump said on Twitter on Sunday that he discussed forming a cyber security unit to guard against election hacking with Russian President Vladimir Putin.

Tweeting after his first meeting with Putin on Saturday, Trump said now was the time to work constructively with Moscow, pointing to a ceasefire deal in southwest Syria that came into effect on Sunday.

"Putin & I discussed forming an impenetrable Cyber Security unit so that election hacking, & many other negative things, will be guarded and safe," he said following their talks at the G20 summit in Hamburg, Germany.

Trump said he had raised allegations of Russian interference in the 2016 U.S. presidential election with Putin.

"I strongly pressed President Putin twice about Russian meddling in our election. He vehemently denied it. I've already given my opinion....."

He added: "We negotiated a ceasefire in parts of Syria which will save lives. Now it is time to move forward in working constructively with Russia!"

Republican Senator Marco Rubio of Florida immediately criticized the move on Twitter, saying Putin was not a trusted partner.

Partnering with Putin on a "Cyber Security Unit" is akin to partnering with (Syrian President Bashar al) Assad on a "Chemical Weapons Unit," he wrote.

Investigations by a special counsel, Robert Mueller, and several U.S. congressional committees are looking into whether Russia interfered in the election and colluded with Trump's campaign. Those probes are focused almost exclusively on Moscow's actions, lawmakers and intelligence officials say, and no evidence has surfaced publicly implicating other countries.

Moscow has denied any interference, and Trump says his campaign did not collude with Russia.

Follow CNBC International on Twitter and Facebook.