He said the killings were “an act of terrorism designed to kill innocent people”.
But “freedom is more powerful than fear,” said President Obama, warning that falling prey to divisiveness in American society would play into the hands of extremists.
He also said the US must make it harder for potential attackers to obtain guns.
Mr Obama vowed that the US would overcome the evolving threat of terrorism, but warned that Americans “cannot turn against one another by letting this fight be defined as a war between America and Islam”.
“If we’re to succeed in defeating terrorism, we must enlist Muslim communities as some of our strongest allies, rather than push them away through suspicion and hate,” Mr Obama said.
He reminded his audience that Muslim-Americans were part of US society.
“And, yes, they are our men and women in uniform who are willing to die in defence of our country. We have to remember that,” he said.
The president warned that turning against America’s Muslim communities would be exactly what Islamist extremists in the so-called Islamic State group want.
Mr Obama told Americans that terrorism had entered a new phase, from large scale attacks by al-Qaeda to less complicated attacks by radicalised individuals.
He said the US would draw upon “every aspect of American power” to combat IS.
He underscored that the US and its allies have increased their bombing of Islamic State oil infrastructure and would continue to train and equip moderate rebels in Iraq and Syria.
“Our military will continue to hunt down terrorist plotters in any country where it is necessary,” he said.
The president added that there are a number of things that can be done on home soil to combat terrorism.
He called for stricter gun control and said he had ordered the Departments of State and Homeland Security to review the K-1 fiance visa programme under which the female attacker in San Bernardino originally entered the US.
This was only the third Oval Office address of Mr Obama’s presidency – they are reserved for events of national importance.
Republican candidates react
Republican presidential frontrunner Donald Trump tweeted to criticise the length of Mr Obama’s statement, which lasted just over 13 minutes. “Is that all there is? We need a new President – FAST!”, Trump said.
Mr Trump, who has been criticised for what many see as anti-Islamic pronouncements, added: “Well, Obama refused to say (he just can’t say it), that we are at WAR with RADICAL ISLAMIC TERRORISTS.”
Senator Ted Cruz, a rival of Mr Trump for the Republican presidential nomination, said: “On December 7, 1941, in response to Pearl Harbor, FDR did not give a partisan speech, rather he called on Americans to unite and ‘win through to absolute victory’.”
Using a different name for IS, he added: “If I am elected President, I will direct the Department of Defense to destroy ISIS. And I will shut down the broken immigration system that is letting jihadists into our country. Nothing President Obama said tonight will assist in either case.”
Former governor Jeb Bush said the president’s remarks were “weak”. Mr Bush said: “This is the war of our time. It shouldn’t be business as usual. We need a war-time Commander-in-Chief who is ready to lead this country and the free world to victory.”
Responding to the address, Florida senator Marco Rubio said Mr Obama’s strategy was “absurd” and called for increased surveillance efforts. “We need to be able to gather more intelligence, not less intelligence,” he said.
Ohio governor John Kasich said the president’s strategy was “not enough” and called for the US to deploy ground troops against IS. He said: “Without taking the fight to ISIS on the ground, ISIS won’t be defeated.”
Carly Fiorina, the former CEO of HP, said the speech was “vintage Obama”. “No strategy, no leadership. Politics as usual,” she said.
George E. Pataki, former governor of New York, controversially said Obama’s address was “as believable as a hostage video”. He said: “Pathetic response to the worst attack on US since 9/11.”
President Barack Obama for the first time made a clear connection between a series of deadly attacks on US soil during his time in office.
The Boston Marathon bombing and shootings at a military base in Texas, an Army recruiting station in Tennessee and now in San Bernardino all represent a “new phase” of “terrorist threat” to the US, he said.
Mr Obama’s goal was to convince an increasingly sceptical US public that he has a plan to address this danger – which doesn’t involve large numbers of US forces in the Middle East, intrusive monitoring of American Muslims or framing the conflict as one with all of Islam.
While the president may find support for a congressional authorisation of military force to fight IS, he will anger many with his call to prevent those on the terrorist watch list from purchasing firearms and place greater limits on the sale of “powerful assault weapons”.
Mr Obama may have ended his speech by urging Americans to unify around their common ideals, but there are few issues more divisive in the US than that of gun rights.