"Still, we are at war. I'm responsible for the deployment of thousands of young Americans. Some will kill and some will be killed."
Receiving the world's highest award for peace, he said there would be times when nations "acting individually or in concert, will find the use of force not only necessary but morally justified."
Obama said he accepted the prize with "deep gratitude and humility" and paid tribute to those who had been jailed or tortured in the pursuit of justice as "far more deserving of this honour".
He said that the United States had "helped underwrite global security for more than six decades with the blood of our citizens and the strength of our arms".
"The service and sacrifice of our men and women in uniform has promoted peace and prosperity from Germany to Korea, and enabled democracy to take hold in places like the Balkans," he said.
In an acceptance dominated by the theme of war, Obama declared he would not "stand idle" in the face of threats to the security of the US and warned of spectre of a new nuclear arms race, potentially in the Middle East or East Asia.
In what was seen as a warning to Iran and North Korea, he called for tough sanctions against nations that did not abide by international laws.
"I face the world as it is, and cannot stand idle in the face of threats to the American people," he said.
Obama has been seen as a controversial nominee for the award because of his country's engagement in wars in Iraq and Afghanistan.
|Anti-war protesters have criticised the decision to award Obama the prize [AFP]
Marwan Bishara, Al Jazeera's senior political analyst, said Obama had offered a "selective reading of [US] history" and had neglected to mention "the thirteen overthrows of government by [the US] of other governments over the last 50 years".
Steve Chao, Al Jazeera's correspondent in Kabul, the Afghan capital, said: "In the last eight years of America's presence, people in Afghanistan have not seen the security situation improve despite the promises of America.
"Obama [in his acceptance speech] ... stressed that any just war must strive to protect civilians and protect them from being killed in the middle of this war.
"And if there is one factor that has turned communities against the US and the Nato presence here it is the fact that a lot of communities have been caught in the middle of the battles, a lot of civilians have died."
Obama received the prize for his "extraordinary efforts to strengthen international diplomacy" according to the citation from the awards committee.
The committee announced its decision in October, when Obama had barely been in office for nine months, recognising his aspirations to reshape the way the US deals with the world more than his actual achievements.
Todd Kent, a US government professor at the Texas A&M University in Qatar, told Al Jazeera that Obama had not expected to receive the award.
"He didn't expect it, he didn't ask for it, so I think it was difficult for him and I think they spent a lot of time trying to downplay the whole award."
Many critics have suggested that Obama has not had a long enough or successful enough period in office to stand with other Nobel peace laureates, but aides say the president will seek to deflect attention from himself during his acceptance speech.
Obama stayed in Oslo for just over 24 hours to pick up the award, joining a list of laureates that include Nelson Mandela, Mother Teresa and Aung San Suu Kyi.
Events related to the formal Nobel Peace Prize ceremony normally run over three days, but the president shortened his visit and excluded the traditional lunch with the king and a Friday night concert in his honour.