President Obama booted 35 Russian spies Thursday and shuttered a massive Long Island compound owned by Moscow in retaliation for interfering with the 2016 election.

“All Americans should be alarmed by Russia’s actions,” Obama said while on vacation in Hawaii. “Such activities have consequences.”

The State Department declared each unidentified intelligence operative “persona non grata” and ordered them out of the US within 72 hours.

Obama also imposed sanctions on six Russians back in the motherland, including four spy-agency officials.

He furthermore targeted a combined five Russian agencies and private firms. They include two intelligence services that the White House has accused of tampering with the presidential election.

Sources said the Long Island property is used for “intelligence-related purposes.”

The Obama administration is also closing down a 45-acre estate at Pioneer Point, Md., outside Baltimore.

Both properties will be closed by Friday at noon.

The Russians control two large properties in Nassau County. It was not clear which was being shuttered.

The larger of the two is the Killenworth estate on Dosoris Lane in Glen Cove, a storied property once owned by philanthropist George Dupont Pratt.

The estate was bought by the Soviet Mission to the United Nations in 1951 and served as a country home and weekend retreat for Russians.

In 1982, federal officials alleged it was being used to eavesdrop on Long Island’s defense-contracting and technology industries, according to The New York Times.

The second mansion is in nearby Oyster Bay. According to a 2009 book by journalist Peter Early, it was used by Russia’s intelligence agency, while the Glen Cove estate was available only to the ambassador and his top deputies.

The Kremlin wasted little time responding to the sweeping rebuke by Obama, vowing to retaliate by Friday.

On Thursday, Russia reportedly closed the Anglo-American School of Moscow, a facility for the children of American and Canadian diplomats.It also shuttered a US Embassy vacation house in Serebryany Bor, near Moscow, according to CNN.

More retaliatory measures were expected.

“I cannot say now what the response will be, although, as we know, there is no alternative here to the principle of reciprocity,” said Russian presidential spokesman Dmitri Peskov.

“The response will be formulated in a direction determined by the president of the Russia.”

The Russian Embassy in London blasted the punishment as a throwback to the Cold War, in a tweet that included a photo of a duckling with the word “lame” over it.

“President Obama expels 35 diplomats in Cold War deja vu. As everybody, incl people, will be glad to see the last of this hapless Adm.,” it read.

Russian political leader Konstantin Kosachev had a similar message.

“This not just an agony of the ‘lame ducks,’ but of the ‘political corpses,’ ” he said, according to the Interfax news agency.

Four Russian intelligence officials were sanctioned: Lt. Gen. Igor Valentinovich Korobov, who heads the agency known as the GRU, and three of his deputies.

Two Russian nationals who have been wanted by the FBI for cyber-crimes, Alexei Belan and Yevgeny Bogachev, also were sanctioned, along with three companies that “provided material support to the GRU’s cyber operations,” Obama said.

Russian officials, including Putin, have denied having any involvement in the hacking, which included cyberattacks on the Democratic National Committee and Hillary Clinton’s campaign.

US intelligence agencies concluded that Russia aimed to help Donald Trump win the White Hosue, an assessment the president-elect has dismissed without offering contrary evidence.

Obama’s move now puts Trump in the position of having to decide whether to roll back the measures once he takes office.

“It’s time for our country to move on to bigger and better things,” Trump said in a statement Thursday evening.

“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.”

Several politicians released statements saying the sanctions were merited and long overdue.

“While today’s action by the administration is overdue, it is an appropriate way to end eight years of failed policy with Russia,” said House Speaker Paul Ryan (R-Wis.).

“And it serves as a prime example of this administration’s ineffective foreign policy that has left America weaker in the eyes of the world.”