The sweeping retaliation follows an intense review of what Obama called "aggressive harassment" of U.S. diplomats in Moscow and "cyberoperations aimed at the U.S. election," a hacking campaign that U.S. officials code-named "Grizzly Steppe."
It also signaled the worst cyberclash of the modern era, with the two former Cold War adversaries now increasingly focused on penetrating each other's digital networks and communications.
In the most dramatic move, the State Department declared 35 intelligence operatives at the Russian Embassy in Washington and the Russian Consulate in San Francisco as personae non gratae. They were given 72 hours to leave the country with their families for "acting in a manner inconsistent with their diplomatic status."
The Obama administration also said it would block access after noon Friday to two properties owned by the Russian government — a 45-acre estate along the Chesapeake Bay in Maryland and 14-acre compound in Long Island, N.Y. — that it says were used by Russian personnel for gathering intelligence.
The broad penalties, three weeks before Obama hands over the White House to
"All Americans should be alarmed by Russia's actions," Obama said in a statement. He said the U.S. moves follow "repeated private and public warnings" to Moscow.
"These actions are not the sum total of our response to Russia's aggressive activities," Obama added. "We will continue to take a variety of actions at a time and place of our choosing, some of which will not be publicized."
Obama said the Russian effort was aimed at interfering with the U.S. election. He stopped short of endorsing FBI and CIA conclusions that the cyberattack was aimed, at least in part, at helping Trump win.
Earlier this month, Obama all but blamed Putin personally, telling reporters that very little happens in the Russian government without Putin's knowledge.
Trump has repeatedly dismissed conclusions from the Office of the Directorate of National Intelligence and the Department of Homeland Security that senior Russian officials directed a campaign to interfere in the fall election.
In a statement Thursday night,Trump made clear he is still not convinced.
"It's time for our country to move on to bigger and better things," he said. "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."
The mass expulsion of alleged Russian spies is the largest in decades, and a Kremlin spokesman, Dmitri Peskov, said Moscow would respond in kind. "I can't say what the response will be, but there is absolutely no alternative to the principle of reciprocity," he said.
Peskov said the U.S. measures were "ungrounded and illegal" and were intended to undermine Trump's calls for warmer relations with Moscow.
In an acerbic statement, Maria Zakharova, Russia's Foreign Ministry spokeswoman, said America had been "humiliated by its own president" and his "hardly literate foreign policy team."
"Not by international terrorists, not enemy armies. Washington's own master slapped it on the face by maximally increasing the number of urgent things to be done by the next administration," she said.
She said Russia would announce countermeasures "and a lot of other things" Friday.
The State Department said it was expelling the 35 Russian diplomats partly in response to the harassment of U.S. diplomats in Russia over the last four years, including the tackling of a U.S. Embassy official by a Russian security guard that was posted on YouTube in June.
"This harassment has involved arbitrary police stops, physical assault, and the broadcast on State TV of personal details about our personnel that put them at risk," State Department spokesman Mark Toner said in a statement. The Russian government has also closed 28 American cultural education centers in Russia and blocked the construction of a new consular office in St. Petersburg.
"Such behavior is unacceptable and will have consequences," Toner said.
Closing the two Russian compounds may be especially painful for Russian diplomats.
One is a sprawling estate called Pioneer Point on Maryland's Eastern Shore that Russia's ambassador to Washington long has used as a weekend retreat.
In 2007, Washington Life magazine described it as a "three-story brick dacha fronting the Chester River." The parcel was purchased by the Soviet government in 1972 and transferred to the Russian Federation in the 1990s.
Russian diplomats based in New York City or at the United Nations have used the Long Island compound for decades as a weekend retreat. A State Department official described both locations on condition of anonymity.
Obama used a newly amended executive order that for the first time authorizes U.S. action in response to attempted "interfering with or undermining" a U.S. election, an expansion of previous authority.
He ordered sanctions against Russia's Main Intelligence Directorate, known as the GRU, and the Federal Security Service, known as the FSB.
Officials said both took part in the hacking and leaking of tens of thousands of emails and other material from the Democratic National Committee and Hillary Clinton's campaign manager, among other targets. The stolen digital trove was posted on WikiLeaks and other websites.
The administration also sanctioned four senior GRU officers — the current chief, Igor Valentinovich Korobov Sergey, and three of his deputies — and three Russian companies that provided material support for its cyberoperations.
Also sanctioned were two notorious Russian hackers, Evgeniy Bogachev and Aleksey Belan, who U.S. officials said had stolen more than $100 million by breaking into the computers of U.S. banks, universities and online retailers.
In a joint analysis from the Department of Homeland Security and the FBI, officials said Russian civilian and military intelligence services had sought to "compromise and exploit networks and endpoints associated with the U.S. election."
It said a GRU-backed hacking group known as Advanced Persistent Threat 29 had "participated in the intrusion into a U.S. political party" in the summer of 2015 and that a separate FSB-backed group had penetrated the computers last spring.
"Both groups have historically targeted government organizations, think tanks, universities and corporations around the world," it said.
It said the two groups were among at least 48 known Russian intelligence hacking units. Some had colorful code names, including Chopstick, Eviltoss, Sandworm and Sourface.
"These cyber operations have included spearphishing campaigns targeting government organizations, critical infrastructure, think tanks, universities, political organizations and corporations," said a separate statement from the FBI, Department of Homeland Security and Office of the Director of National Intelligence.
The administration announced the moves while Obama is on a two-week vacation with his family in Hawaii. He has promised to deliver a classified report to Congress on the hacking before he leaves office Jan. 20.
Obama's actions drew broad support in Congress, though with partisan overtones.
House Speaker Paul D. Ryan (R-Wis.) called the measures "overdue," saying the Obama administration had waited too long to stand up to Russia.
Sen. Charles E. Schumer (D-N.Y.), the incoming Senate minority leader, applauded the decision to "punch back against Russia," but he worried about how Trump might react. Since Obama used an executive order, Trump could cancel or ease the crackdown after he takes office.
"I hope the incoming Trump administration, which has been far too close to Russia throughout the campaign and transition, won't think for one second about weakening these new sanctions or our existing regime," Schumer said.
Several lawmakers say they plan to further investigate Russia's role in the hacks and press for harsher penalties against Moscow.
Sens. John McCain (R-Ariz.) and Lindsey Graham (R-S.C.) said they would push for stronger sanctions on Russia when Congress returns to Washington on Jan. 3.
Parsons reported from Honolulu and Bennett from Washington. Special correspondent Mansur Mirovalev in Moscow contributed to this report.
2:55 p.m.: This story was updated with details of the U.S. and Russian response.
11:35 a.m.: This story was updated with details on the U.S. response.