President Obama and Russian President Vladimir Putin at the Asia-Pacific Economic Cooperation summit in Lima, Peru, on Nov. 20, 2016. (Brendan Smialowski/AFP/Getty Images)

— Russian President Vladimir Putin is warning that his forces could target NATO sites if his country feels threatened.

But it’s not so much the warning that’s important; it’s the timing.

“We are forced to take countermeasures — that is, to aim our missile systems at those facilities which we think pose a threat to us,” Putin said in an interview with American filmmaker Oliver Stone for a documentary broadcast Monday. “The situation is heating up.”

Putin’s harsh words for the Western alliance were broadcast on Russian television as ­President-elect Donald Trump, who has been critical of NATO, pulls together a team and calls for closer ties with the Kremlin.

The broadcast of Putin’s warning came just days after his spokesman suggested that Trump could build confidence in Moscow by persuading NATO to move its forces back from the Russian border.

Just hours before the Kremlin leader’s threat hit the airwaves, Russia announced that it had bolstered its defensive missile strength in Kaliningrad, a Russian enclave wedged between NATO members Lithuania and Poland.

The Stone-produced documentary — about the events that led up to the conflict in Ukraine between pro-Moscow separatists and the Western-allied government — premiered on Russian television after advance transcripts of Putin’s remarks were circulated by Russian state-run media.

“Why are we reacting to NATO expansion so emotionally? We are concerned by NATO’s ­decision-making,” Putin said. 

Smaller NATO countries would find it “next to impossible to resist pressure from a major NATO leader such as the United States” to deploy missile systems or host new bases, he said.

“And what are we supposed to do?” Putin said in the interview for Stone’s “Ukraine on Fire.”

Putin and his diplomats have threatened to strike NATO in self-defense before, as the alliance increasingly focuses on the threats it perceives from Russia.

But for the Stone interview, Putin “probably guessed that this documentary would be aired when the new POTUS was already elected, so in part that’s messaging to the new president,” said Simon Saradzhyan, founding director of the Russia Matters Project at the Harvard Kennedy School’s Belfer Center for Science and International Affairs.

Putin probably expected that his message would be heard by Hillary Clinton. But a major wild card has been introduced by the election victory of Trump, who has called the alliance a bad deal for America and has suggested that his administration will seek to improve relations with Russia.

In October, Putin stationed nuclear-capable land- and ship-based cruise missiles in Kaliningrad, following a July decision by NATO to send additional troops to the region.

The brinkmanship also extends to defenses against possible cyberattacks.

Finland’s undersecretary of state, Jori Arvonen, told reporters Monday that a joint ­NATO-European Union center is planned for Helsinki to study “hybrid” warfare, including ­cyberespionage and propaganda via social media.

Arvonen said the planned center will seek to battle online incursions that could be “diplomatic, military, technological or financial in their nature.”

U.S. intelligence officials suspect high-level Russian involvement in email-hacking targeting Clinton’s campaign chief and others during the presidential campaign.

Brian Murphy in Washington contributed to this report.