President Trump lashed out at former President Barack Obama's actions ahead of the 2016 election, saying he's done more to protect the 2018 elections than Obama did in 2016.

Trump signed an executive order in September that lays out a framework for imposing sanctions against foreign officials and governments who attempt to meddle in U.S. elections. Intelligence and national security officials have said that Russia is trying to interfere in the midterm elections, and U.S. agencies and local governments are working together to protect election infrastructure from foreign interference.

"In terms of meddling, Obama was told in September, just ahead of the election, that Russia was trying to meddle in the election. He didn't say anything about it or do anything about it. He only brings it up after the election," Trump said in an interview aired Tuesday night on Fox Business.

Trump said that he spoke with Russian President Vladimir Putin and told him not to meddle in elections, whereas Obama spoke with the country's second in command. Obama has said he spoke with Putin directly during a visit to China, telling him to "cut it out" on election hacking.

Trump also said Obama's actions — or lack thereof — should be investigated.

"You know what he did? Nothing. You know why? He thought Hillary Clinton was going to win and he didn't want to do anything to upset that," Trump said.

[Trump: DOJ, FBI 'played' by Russia into creating division, chaos with investigation]