The court voted 4 to 3 on Friday in favor of dismissing allegations of illegal campaign financing and abusing political and economic power against 2014 running mates Rousseff and Temer.
The Brazilian Social Democrat Party contested the results of the 2014 election, claiming there were irregularities in the winning ticket's donations and alleging Rousseff and Temer received campaign funds from a massive corruption scheme known as the Car Wash Operation.
Superior Electoral Court minister Gilmar Mendes said Rousseff and Temer's accounts were approved for review, but not for summary of conviction and added it was not the court's responsibility to "solve the political crisis" of the country.
"First, it is necessary to judge, and then to condemn. This issue is sensitive because it has as its background the popular sovereignty," he said.
Presidential spokesman Alexandre Parola told the Rio Times that Temer will follow by the court's ruling with "sobriety, humility and respect."
Temer was Rouseseff's vice-presidential candidate in 2014 and became president after Rousseff was removed in 2016 for borrowing money from state-owned banks to pay for federal social programs.
Although Temer avoided a court ruling that may have removed him from the presidency, he still faces a scandal surrounding a secret recording between himself and Joesley Batista, president of JBS food processing company, discussing paying bribes.
Batista said Temer condoned payments to silence a jailed legislator, but Temer has denied the claims and stated the recording was doctored.
The Supreme Court also opened an investigation into Temer's alleged corruption and his approval rating has reached single digits.