Former CIA Director John Brennan slammed President Trump Tuesday for asserting that he was tougher than former President Barack Obama on Russia.

“It never ceases to amaze me how successful you have been making yourself so small, petty, and banal with your tweets,” Mr. Brennan told the president on Twitter. “Your insecurity is well deserved, as is your concern over Russia investigation.”

The ex-CIA chief concluded, “Thomas Paine was right when he said, “These are the times that try men’s souls.”

He was responding to Mr. Trump’s tweet earlier Tuesday in which the president said, “I have been much tougher on Russia than Obama, just look at the facts. Total Fake News!”

Mr. Brennan led the CIA from 2013 to January 2017, when Mr. Trump became president. Mr. Trump has stepped up his comments online about Russia since special counsel Robert Mueller won indictments on Friday against 13 Russian individuals and three Russian groups for meddling in the 2016 election.

Mr. Trump has repeatedly questioned why the Obama administration didn’t do more to stop the election interference.

Former Obama national security spokesman Ned Price said on MSNBC Tuesday that the Obama administration warned voters about the meddling one month before the election. He said the Obama team “wanted to do more,” but Senate Majority Leader Mitch McConnell wouldn’t go along with a tougher stance.

He also noted that Mr. Obama ejected 35 Russian spies from the U.S. after the election.

Former Vice President Joseph R. Biden said last month that Mr. McConnell refused to sign on to a bipartisan statement of condemnation of Russia before the 2016 election.

Mr. McConnell’s office has noted previously that all four congressional leaders signed a letter in September 2016 to the president of the National Association of State Election Directors, urging cybersecurity precautions due to reports of attempted hacking.

“The Obama White House asked congressional leaders to sign a bipartisan letter on protecting election systems, which of course all four leaders signed,” said McConnell spokesman Don Stewart.

A month later, Mr. Obama’s Secretary of Homeland Security and Director of National Intelligence issued a joint statement about Russia’s interference in the election.