President Barack Obama declared "peace is possible" between Israelis and Palestinians in a new op-ed published in the Israeli newspaper Haaretz on Monday night.

"As I said last year in Jerusalem, peace is necessary, just, and possible. I believed it then. I believe it now. Peace is necessary because it’s the only way to ensure a secure and democratic future for the Jewish state of Israel," Obama wrote. "Reaching a peace agreement with the Palestinians would also help turn the tide of international sentiment and sideline violent extremists, further bolstering Israel’s security."

The op-ed comes at a time of particular hostility in the Middle East. Three Israeli teens — one of whom was an American citizen — were kidnapped and murdered in June. Later, in an apparent act of revenge, a Palestinian teen was brutally murdered.

Obama said "as a father" he could relate to the pain of both sides' innocent victims.

"And as a father myself, I cannot imagine the pain endured by the parents of Naftali Fraenkel, Gilad Shaar and Eyal Yifrach, who were tragically kidnapped and murdered in June. I am also heartbroken by the senseless abduction and murder of Mohammed Hussein Abu Khdeir, whose life was stolen from him and his family. At this dangerous moment, all parties must protect the innocent and act with reasonableness and restraint, not vengeance and retribution," he wrote.

Obama labeled these sorts of incidents as "setbacks and moments of frustration" in the overall peace process.

"This is one of the most important things to remember during setbacks and moments of frustration. It will take political will to make the difficult choices that are necessary and support from the Israeli and Palestinian people and civil society," he wrote.

"Both parties must be willing to take risks for peace. But at the end of the day, we know where negotiations must lead—two states for two peoples. Refusing to compromise or cooperate with one another won’t do anything to increase security for either the Israeli or the Palestinian people."

Obama praised Palestinian President Mahmoud Abbas for being "committed to a two-state solution and security cooperation with Israel."