NEW YORK - Israeli Prime Minister Benjamin Netanyahu met with U.S. Democratic presidential candidate Hillary Clinton in New York on Sunday evening, hours after sitting down with her Republican rival Donald Trump.

In the meeting, Clinton stressed “her opposition to any attempt by outside parties to impose a solution" to the Israeli-Palestinian conflict, "including by the UN Security Council," according to a statement released by her campaign. She further reaffirmed her commitment to a two-state solution negotiated directly by the parties.

The meeting at the W Hotel began at 6:30 P.M. and lasted about an hour.

According to the statement, Clinton said a "strong and secure Israel" is vital to the United States. She also "reaffirmed her unwavering commitment" to the U.S.-Israel relationship and stressed her support for the new military aid agreement reached earlier in September and her commitment to countering efforts to boycott Israel.

Open gallery view U.S. Democratic presidential candidate Hillary Clinton waves as she arrives for a meeting with Israel's Prime Minister Benjamin Netanyahu at a hotel in New York, September 25, 2016. Credit: Carlos Barria, Reuters

Netanyahu, in turn, laid out Israel's positions on Mideast security issues "as well as Israel's efforts to achieve peace and stability in our region," according to a statement released by the prime minister's bureau. The prime minister also thanked Clinton for her "friendship and support for Israel."

The prime minister's bureau released an identical statement following his meeting with Trump.

Israeli Ambassador to Washington Ron Dermer and Clinton adviser Jake Sullivan were present at the meeting.

During the meeting with Trump, the Republican presidential candidate told the Israeli prime minister that if elected, he "would finally accept the long-standing Congressional mandate to recognize Jerusalem as the undivided capital of the State of Israel," according to a statement released by Trump's campaign.

Sources close to Netanyahu said after the meeting with Trump that the prime minister visited the candidates, rather than their coming to him, because he understood the time pressure they were under in the run-up to the debate between them on Monday.

A senior Israeli official said that the meetings between Netanyahu and Trump materialized over 24 hours on Friday, starting with a phone call the candidate's aides held with the prime minister's advisers. Once it was clear that a meeting between the two was possible, Netanyahu's office contacted Clinton's campaign and asked to hold a meeting with her too, in order to keep the balance.

Netanyahu has made it his policy in recent months that Israel would maintain absolute balance in its contacts with the two candidates in the White House race. Netanyahu, who in 2012 acted in a way that was perceived as him interfering on behalf of nominee Mitt Romney and against the incumbent president, Barack Obama, is interested in avoiding giving even the slightest impression of interference.

"The prime minister's instruction was clear – if we meet with one side, we must also meet with the other side," the senior official said. "We are following the number of meetings to make sure that one side doesn't get more meetings than the other."

AP contributed to the report.