Updated at 5:31 p.m. ET

President Obama on Friday vigorously defended his handling of Russian interference in the election, saying he did not retaliate against Moscow because he feared undermining public confidence in the integrity of the vote.

“My principal goal leading up to the election was making sure that the election itself went off without a hitch,” the president said in his final year-end press conference. “That it was not tarnished and that it did not feed any sense in the public that somehow tampering had taken place with the actual process of voting. And we accomplished that.”

“That does not mean that we were not going to respond,” Obama added. “At a point in time when we’ve taken certain actions that we can divulge publicly, we will do so.” He did not detail what form that retaliation could take, and he acknowledged that the United States might choose not to publicize its response, in the same way that Vladimir Putin has not gone around bragging about the impact he’s had on the American election.

Obama spoke to reporters in the aftermath of reports that both the FBI and the CIA believe that Russia hacked Democratic email accounts and then leaked their contents in a deliberate attempt to help Donald Trump defeat Hillary Clinton. He described a series of difficult decisions he faced in the midst of a heated campaign, including how much to disclose to the public and whether to hit back at Putin, the Russian president who Obama strongly suggested was behind the cyberattack.

Ultimately, Obama chose to have the director of national intelligence release a statement in October identifying the Russian government as the likely source of the hacks, but intelligence officials did not accuse Moscow of trying to elect Trump until after the election. Nor did Obama publicly call out Putin or take retaliatory action. Instead, the president said he pulled Putin aside at a global conference and told him to “cut it out and there were going to be serious consequences if he didn’t.”

Why didn’t he take stronger action? Obama suggested his hands were tied by a hyperpolarized political environment and that any statement or action he took would be seen as trying to undermine Trump and aid Clinton. And he feared provoking Putin further. In part, Obama acknowledged, he wanted to make sure the initial meddling “wasn’t compounded by potential hacking that could hamper vote counting, affect the actual election process itself.”

The president betrayed no regrets about his own actions.

“Imagine if we had done the opposite,” he said. “It would have become immediately one more political scrum.”

“I think we handled it the way it should have been handled,” Obama added.

Instead, the president wagged his finger at media outlets that amplified the leaked emails on a daily, if not hourly, basis. “You guys wrote about it every single day,” Obama said, his voice rising. “Every single leak about every little juicy tidbit of political gossip. Including John Podesta’s risotto recipe. This was an obsession that dominated the news coverage.”

Obama spoke shortly after The Washington Post reported that the directors of both the FBI and national intelligence concurred with the CIA’s assessment that Russia was trying to help Trump. FBI Director James Comey’s view is noteworthy in light of the criticism he has faced from Democrats for sending a letter to Congress 10 days before the election announcing that investigators were taking a look at new emails linked to Clinton’s private server. Clinton on Thursday night blamed both the letter and the Russian hack for her defeat, telling donors at a party in Manhattan that Putin was getting back at her as part of a years-old “personal beef.”

Obama stopped short of concluding that either Comey or Putin was directly responsible for Clinton’s defeat. “I’m going to let all the political pundits in this town have a long discussion about what happened in this election,” he said. “It was a fascinating election.”

The president declined to directly criticize Trump for his comments in recent days casting doubt on claims of Russian interference. He said his conversations with the president-elect had been “cordial as opposed to defensive in any way.”

But Obama launched a broader critique of a political and media climate that, he argued, had devolved into such partisanship that it allowed Putin to effectively gain influence and enhance his standing among Republican voters. He cited a recent poll in which more than one-third of GOP respondents held a positive view of the former KGB agent. “Ronald Reagan would be rolling over in his grave,” the president said.

Questions about Russia dominated what might have been Obama’s final press conference as president. He was due to fly to Hawaii for a two-week Christmas vacation directly afterward. The president appeared downcast at times, resigned to an election outcome in which one of his chief foreign adversaries seemed to have more influence with American voters than he had.

“The Russians can’t change us or significantly weaken us. They are a smaller country, they are a weaker country, their economy doesn’t produce anything that anybody wants to buy except oil and gas and arms. They don’t innovate. But they can impact us if we lose track of who we are. They can impact us if we abandon our values.”

Obama would not offer a message to members of the Electoral College who will meet on Monday to, in all likelihood, ratify Trump’s victory. Nor did he join growing calls from Democrats to eliminate the Electoral College altogether.

Obama also addressed the unfolding humanitarian crisis in Aleppo, calling the civil war in Syria “one of the hardest issues that I’ve faced as president.” He pushed for an impartial observatory force to coordinate an evacuation of the besieged city, as well as a broader ceasefire that has thus far been impossible to sustain. “Responsibility for this brutality lies in one place alone,” he said. “With the Assad regime and its allies, Russia and Iran, and this blood and these atrocities are on their hands.”

“Over the long term, the Assad regime cannot slaughter its way to legitimacy,” Obama added. “The world cannot avert its eyes.” Images of blood-streaked women and children in Aleppo and pleas for help have horrified the world in recent days, and Obama has faced criticism that his failure to intervene will be a stain on his legacy. He was asked if he felt responsible for the mounting civilian carnage.

“I always feel responsible,” Obama replied. He launched into a monologue that was, if not a defense of his often-maligned policy in Syria, then at least an explanation. “I ask myself every single day, ‘Is there something I could do that would save lives and make a difference? And spare some child who doesn’t deserve to suffer?’” he said. “So with respect to Syria, what I have consistently done is taken the best course that I can to try to end the civil war while having also to take into account the long-term national-security interests of the United States,” Obama continued. He concluded that “short of putting large numbers of U.S. troops on the ground, uninvited,” the crisis was not easily fixed.