President Obama speaks during a news conference on Friday in the Brady Press Briefing Room in Washington. The president claimed an array of successes in 2014, including lower unemployment. (Carolyn Kaster/Associated Press)

President Obama on Friday chastised Sony Pictures for shelving a satirical movie following a North Korean cyberattack and vowed that the United States would take retaliatory action against the hermit nation.

“I think they made a mistake,” the president said of Sony’s decision to stop distribution of the movie. “We cannot have a society in which some dictator someplace can start imposing censorship here in the United States.”

The Sony comments came in a nearly hour-long, wide-ranging news conference during which Obama made a case that America’s economy and global leadership were resurgent. He pointed to a lengthening streak of job increases and the strengthening U.S. economic recovery as well as the role the country is playing in enforcing Russian sanctions, containing the Islamic State in Iraq and Syria, and combating Ebola.

Obama spoke at the end of his sixth year in office and with the end of his term in view. He had billed this year as one in which he would bounce back from a stumbling 2013, but 2014 turned out to be equally tough. His optimistic tone on Friday reflected the productive weeks he’s had since the midterm elections, which he hopes will help define a more positive presidential legacy.

The president declined to telegraph what actions the United States would take against North Korea but said that his administration was preparing a “range of options.” He vowed again to respond to the computer attack “proportionally” and “in a place and time and manner that we choose.” That response was a tacit acknowledgment of how the relatively new threat of cyberattacks was upending traditional American notions about security and what constitutes an act of aggression.

The president called for closer government coordination with the private sector in the United States — “we’re not even close to where we need to be,” he said — and the need to develop clearer rules internationally about how to respond to such attacks from weak states and terrorist groups.

Mostly, though, he called for calm in the face of future attacks.

“I think all of us have to anticipate occasionally there are going to be breaches like this. They’re going to be costly. They’re going to be serious,” Obama said. “But we can’t start changing our patterns of behavior.”

Sony Pictures Entertainment later issued a statement saying it was “strongly committed to the First Amendment.” The decision to cancel the film, the company said, was driven by theater owners who declined to screen it. “This was their decision,” the company said. “We had no choice.” Sony also said it will look into an online release of the film, which portrays a fictional CIA plot to send two comical television show figures to assassinate the North Korean leader.

Throughout the news conference at the White House briefing room, the president focused on the growing economy and foreign policy victories that have characterized the past five weeks of his presidency, glossing over the frustrating 11 months that preceded them. He called 2014 “a breakthrough year for America,” citing the recent pickup in job growth, new enrollees in health-care exchanges, climate agreements with China and this week’s opening to Cuba.

“As a country, we have every right to be proud of what we’ve accomplished: more jobs, more people insured, a growing economy, shrinking deficits, bustling industry, booming energy,” Obama declared. “Take any metric that you want, America’s resurgence is real. We are better off.”

Barely acknowledged were the setbacks that dominated his presidency for much of the year, including the ongoing chaos in Syria and Iraq, a country where the United States has spent more than $1 trillion over the past decade and almost 4,500 U.S. troops were killed. In June, Islamic State militants took control of Mosul, but Iraq received no mention over the course of the hour.

On Afghanistan, which is now the longest war in American history, Obama quickly noted that American combat operations would cease in two weeks and more American troops would be home for the holidays than at any other time in the last decade.

“Yes, there were crises that we had to tackle around the world, many that were unanticipated,” Obama said, citing the U.S. role in leading coalitions to check Russian aggression in Ukraine, halt the advance of Islamic State militants in the Middle East and fight Ebola in Africa.

“We have every right to be proud of what we’ve accomplished,” he said.

The president celebrated his breakthrough deal with Cuba, which normalized relations with Havana for the first time since the Eisenhower administration and predicted that change would slowly come to a nation that has been stuck in place for more than 50 years.

Obama played down the possibility of a meeting with Cuban President Raúl Castro during the remaining years of his presidency, saying that such a visit wasn’t “in the cards.” But he was confident that the island, which he called a “hermetically sealed society,” would open in “fits and starts.”

“I’m a fairly young man, so I imagine that at some point in my life, I will have the opportunity to visit Cuba and enjoy interacting with the Cuban people,” Obama said.

Despite six years of partisan warfare in Congress, Obama sounded his annual theme of optimism when it comes to working with GOP lawmakers, citing tax reform and infrastructure as issues that have the promise to break through the partisan gridlock.

“I think there are real opportunities to get things done in Congress,” Obama said. “I take [House] Speaker [John A.] Boehner and [Sen.] Mitch McConnell at their words that they want to get things done. I think the American people would like to see us get some things done.”

But the president said he had no illusions about the fact that there are many issues on which both sides disagree, and he vowed to put up “stiff resistance” if Republicans try to meddle with the Affordable Care Act or dilute consumer protection laws.

Obama also said he would employ executive actions when he sees fit.

“I intend to continue to do what I’ve been doing, which is where I see a big problem and the opportunity to help the American people, and it is within my lawful authority to provide that help. I’m gonna do it,” he said. He then reached out to Congress and said, “Let’s work together. I’d rather do it with you.”

Obama again told lawmakers that if they are bothered by executive actions, they can work with him to pass a bill codifying the measures into law.

Obama held out hope for tax reform and ticked off his priorities: making sure companies paid similar rates, preventing companies from “parking money outside the country” to avoid taxes, and “corporate inversion” that allows companies to buy smaller overseas firms to pay lower taxes in foreign jurisdictions.

“We know that there are companies that are paying the full freight, 35 percent, higher than just about any other company on Earth,” Obama said. “And then there are other companies that are paying zero, because they’ve got better accountants or lawyers. That’s not fair.”

The president also linked tax reform to his plea for a federally financed infrastructure program, calling it “one other element of this that I think is important.”

Making all that happen could be difficult. Congressional Republicans have repeatedly blocked Obama’s efforts to enact an infrastructure spending bill. And corporate tax reform would need to find a way through a host of corporate interest groups, many of which cannot agree about what is a loophole and what is a vital incentive.

The final question to Obama asked that he assess the state of black America.

As the nation’s first black president, Obama has often faced critics on both the right and left who cite high unemployment and poverty rates among black Americans. While noting that racial gaps still exist in employment and education, Obama insisted that the experience of being black in America has improved since his historic election in 2008.

“Like the rest of America, black America in the aggregate is better off now than it was when I came into office,” Obama said. “The jobs that have been created, the people who’ve gotten health insurance, the housing equity that’s been recovered, the 401 pensions that have been recovered — a lot of those folks are African Americans. They’re better off than they were.”

But the president also acknowledged the awakened racial tensions that have spurred protests in several American cities, noting that there is “a growing awareness in the broader population” of the perception of race-based inequalities in the justice system.

Obama has addressed the racial unrest in Ferguson, Mo., and across the country only a few times, each time stressing that America has made generational progress on racial issues and framing the current moment as a period of revelation for the country as a whole. At the same time, he has admonished violent demonstrators and defended the legal system.

“I actually think it’s been a healthy conversation that we’ve had. These are not new phenomena. The fact that they’re now surfacing, in part because people are able to film what have just been, in the past, stories passed on around the kitchen table, allows people to, you know, make their own assessments and evaluations,” Obama said. “And you’re not going to solve the problem if it’s not being talked about.”

Yet protest leaders in cities such as Ferguson, Cleveland and New York remain deeply disillusioned with Obama, angered that his remarks on race and law enforcement have not gone farther and that the president himself has not taken a more pointed stance on the individual police shootings that have prompted the demonstrations. Despite the creation of a task force to examine policing nationwide and his dispatching of Attorney General Eric H. Holder Jr. on a speaking tour, many of the most vocal protesters do not say Obama has done enough.

Katie Zezima, Wesley Lowery, Cecilia Kang and Juliet Eilperin contributed to this report.