Obama said keeping US citizens safe is his top priority and he suggested that it should also top the list for whomever Americans elect in November due, in part, to the threat posed by the Islamic State group and other extremist organisations.
How those issues are handled is important, he said. Leaders need to recognise "that security is not just a matter of military actions but is a matter of the messages we send and the institutions that we build and the diplomacy that we engage in and the opportunities that we present to people," Obama said in a question-and-answer session with young leaders. Such events are a staple of his foreign travels.
Obama held up the recent nuclear deal with Iran as an example of the power of diplomacy over force. "Doing so without going to war is something I'm very proud of," he said.
The question, however, was about priorities for his successor and the audience applauded loudly when the questioner suggested that person will be a "she," as in Democrat Hillary Clinton, or "could be Bernie," a reference to the other Democrat still in the race, Bernie Sanders.
Asked about his legacy, the president said he wouldn't have a good feel for it "until 10 years from now and I can look back with some perspective." But still, he cited his health care law, financial industry reform, the Iran nuclear deal and "saving the world economy from a great depression" among the issues he hopes to be remembered for.