The United States has expelled 35 Russian diplomats and closed two Russian compounds in a response that Barack Obama says was "necessary and appropriate" against "efforts to harm US interests".

Obama, whose term as as US president ends next month, said on Thursday that actions against Russia are "a necessary and appropriate response to efforts to harm US interests in violation of established international norms of behaviour".

The move against the diplomats from the Russian embassy in Washington and consulate in San Francisco is part of a series of actions announced on Thursday to punish Russia for what the official said was a campaign of intimidation of American diplomats in Moscow and interference in the US election.

Secrets and hacks: Russia's role in the US election

Obama said a report by his administration about Russia's efforts to interfere in the 2016 election would be delivered to Congress in the coming days.

"The Department of Homeland Security and Federal Bureau of Investigation are releasing declassified technical information on Russian civilian and military intelligence service cyber activity," Obama said in a statement.

Al Jazeera's Kimberly Halkett, reporting from Washington DC, said that the US administration had not provided any proof of Russia's involvement other than the flat accusations that 17 US intelligence agencies say so.

A senior US official told Reuters news agency that the Russian diplomats would be given 72 hours to leave the country and access to the two compounds [in New York and Maryland], which are used by Russian officials for intelligence gathering, will be denied as of noon on Friday.

"These actions were taken to respond to Russian harassment of American diplomats and actions by the diplomats that we have assessed to be not consistent with diplomatic practice," the official said.

Today, Treasury sanctions two individuals for malicious cyber-enabled activities. https://t.co/c4LKHoEhwZ pic.twitter.com/0M24mshs0f — Treasury Department (@USTreasury) December 29, 2016

Our correspondent said: "The White House is calling this a national emergency. This is one of the strongest responses we've ever seen from the US against what it says was a state-sponsored cyberattack."

She said sanctions have been imposed on two Russian intelligence services, including four military intelligence officers, that the White House believes may have directly ordered the hacking that took place over the summer.

The US official declined to name the diplomats who would be affected, although it is understood that Russia's ambassador to the US, Sergey Kislyak, will not be one of those expelled.

Harassment of diplomats

Obama said that all Americans should be alarmed by Russia's actions, adding that data theft and disclosure activities could only have been directed by the highest levels of the Russian government.

Obama also said the US diplomats have experienced an unacceptable level of harassment in Moscow by Russian security services and police over the past year.

The state department has long complained that Russian security agents and traffic police have harassed US diplomats in Moscow, and John Kerry, the US secretary of state, has raised the issue with Russian President Vladimir Putin and his foreign minister, Sergey Lavrov.

WATCH: Are Russia and the US entering a new Cold War?

The developments come less than a month from the presidential inauguration of Donald Trump, who has called for better relations with Russia.

Dmitry Peskov, the Kremlin spokesman, said the new round of US sanctions against Russia would harm relations between the two countries.

He said Putin would order an "appropriate" retaliation to the sanctions.