OSLO  President Obama used his acceptance of the Nobel Peace Prize on Thursday to defend the idea that some wars were necessary and just, remind the world of the burden the United States had borne in the fight against oppression and appeal for greater international efforts for peace.

“We must begin by acknowledging the hard truth: we will not eradicate violent conflicts in our lifetimes,” Mr. Obama said, addressing the paradox of receiving an award for peace as commander in chief of a nation that is escalating the war in Afghanistan as it continues to fight in Iraq. “There will be times when nations  acting individually or in concert  will find the use of force not only necessary but morally justified.”

He delivered a mix of realism and idealism, implicitly criticizing both the Rev. Dr. Martin Luther King Jr. as inadequately appreciating the dangers of the world, and President George W. Bush as too quick to set aside fundamental American values in pursuit of security. And he embraced the concept of American exceptionalism, the idea that the United States has a special role as a defender of liberty, even as he promoted multilateralism.

In that way, he continued a pattern evident throughout his public career of favoring pragmatism over absolutes.