WASHINGTON, Dec. 30 (Xinhua) -- Three weeks before leaving office, U.S. President Barack Obama on Thursday struck back at Russia over alleged election hacking in a move to box in his successor Donald Trump who had so far showed willingness to work with Russia.

Nine Russian entities and individuals, including two Russian intelligence services, were sanctioned for their alleged interfering with the U.S. election, Obama said in a statement.

In addition, the U.S. State Department on Thursday announced expelling 35 Russian government officials from the United States, calling them "acting in a manner inconsistent with their diplomatic status."

Two Russian government-owned compounds, one in U.S. State of Maryland and one in New York, would also soon be shuttered, according to the State Department.

Dmitry Peskov, spokesman for Russian President Vladimir Putin, said that Moscow regretted the new sanctions and the measures signaled Obama's "unpredictable" and "aggressive foreign policy."

According to Russia's Interfax News Agency, Peskov said that the dual aims of the White House were "to ruin once and for all Russian-American relations" and "to strike a blow against the foreign-policy plans of the future administration and the new U.S. president."

The Obama administration in October officially blamed Russia for hacking U.S. political institutions and persons to interfere with the U.S. election process, an accusation immediately dismissed as "nonsense" by Moscow.

The episode reached its climax early this month when the U.S. daily Washington Post uncovered a secret Central Intelligence Agency (CIA) assessment report in which the agency claimed that Russia's meddling in the U.S. election was aimed at helping Republican Donald Trump win the White House.

According to the CIA assessment, Russians were believed to have hacked both Republican and Democratic organizations, though only damaging documents from Democrats were leaked to the public.

After initially declining to endorse the CIA assessment, Federal Bureau of Investigation Director James Comey and National Intelligence Director James Clapper later reportedly agreed that Russia intervened in part to help Trump.

Russia had for long repeatedly denied being behind the cyber attacks which led to the leaking of damaging material which dogged Democratic presidential nominee Hillary Clinton till the Election Day.

In the statement, Obama said the data theft and disclosure activities "could only have been directed by the highest levels of the Russian government."

"These actions follow repeated private and public warnings that we have issued to the Russian government, and are a necessary and appropriate response to efforts to harm U.S. interests in violation of established international norms of behavior," said Obama.

While the new measures against Russia were widely expected, the severity and bluntness were rare and represented a new low in U.S.-Russian relations. It was the first time that names of Russian officials allegedly involved in cyber attacks were made public on the U.S. sanction list.

The Obama administration's new measures also appeared in part to aim at boxing in Trump, who had consistently cast doubt on Moscow's involvement in the cyber attacks and once even suggested that the hacking could have been done by a "400-pound guy" in New Jersey.

After the announcement of new sanctions against Russia, Trump said it was time for the United States to "move on."

"It's time for our country to move on to bigger and better things," said Trump in a statement.

"Nevertheless, in the interest of our country and its great people, I will meet with leaders of the intelligence community next week in order to be updated on the facts of this situation."