President Obama arrived in New York City on Sunday evening for three days that will mix election-year politics with a farewell to the world stage at the United Nations. But the visit comes against a suddenly tense backdrop, after a powerful explosion rocked a Manhattan street and a man claiming fealty to the Islamic State stabbed several people in a Minnesota shopping mall.

The president’s diplomatic schedule also got more complicated. The White House announced Sunday that he would hold meetings at the United Nations with leaders from Israel and China. Both will be closely watched for signs of friction in relationships that have been marked by tension during Mr. Obama’s tenure.

On Wednesday, he is scheduled to confer with Prime Minister Benjamin Netanyahu of Israel at a time when he is weighing whether to propose his own framework for a peace agreement between Israel and the Palestinians over Mr. Netanyahu’s objections. The two leaders have clashed repeatedly over the Iran nuclear agreement and Mr. Obama’s pursuit of Middle East peace.

The meeting could be their last face-to-face encounter before Mr. Obama’s term ends in January. Last week, the United States and Israel sealed a $38 billion, 10-year American security aid package to Israel, the largest ever granted to an ally. Officials in both countries have characterized the deal as proof that the American-Israeli relationship is enduring, whatever the strains between the two men.