NEW YORK--U.S. Secretary of State John Kerry met his Iranian counterpart Javad Zarif on Sunday for talks on Iran's nuclear program and the threat posed by Sunni extremist group Islamic State, a senior State Department official said.

The discussions on Syria come as Washington and Tehran have both insisted they won't cooperate militarily in the fight against Islamic State in Iraq or Syria.

The U.S. is building an international coalition to fight Islamic State but so far has excluded Iran from that group, although the two countries have discussed events in Iraq a number of times in recent weeks.

Mr. Zarif has slammed the U.S.-led group as "the coalition of the repenters," saying many of the countries now pledging to fight the Sunni extremists have been supplying or assisting them over the past few years.

A State Department official said Mr. Kerry and Mr. Zarif met for over an hour on Sunday, first one-on-one and then joined by other senior diplomats.

"Separate and apart from the nuclear issue, they also discussed the threat posed by ISIL," said the official, using the acronym for one of Islamic State's former names. "Going forward, the Secretary and Foreign Minister Javad Zarif agreed to meet further as needed while in New York this week."

The official gave no further detail on the Islamic State discussion.

On Thursday, U.S. President Barack Obama will chair a UN Security Council meeting on the threat posed by foreign fighters who join the conflict in Iraq and Syria. Iran has intervened militarily in Syria to support the Assad regime but Iranian officials say Tehran has sent only advisers and assistance to help Iraqi and Kurdish forces fight Islamic State.

Mr. Kerry and Mr. Zarif also discussed the latest development in the talks on Iran's nuclear program. Iran and six powers including the U.S. are seeking to reach a final agreement by Nov. 24 setting limits on Tehran's future nuclear activities in exchange for a gradual lifting of sanctions.

The full nuclear talks resumed after a two month gap on Friday, although senior U.S. and Iranian diplomats met earlier in the week for talks. A senior U.S. official said on Thursday they came to New York "not very optimistic" about the outlook for the decade-long diplomacy.

The official pressed Iran to show flexibility in the coming days when the Iranian and U.S. presidents will be in New York for the annual U.N. General Assembly meeting, calling this "a unique opportunity" for progress.

Diplomats on both sides have said there are still major gaps between Iran and the six powers on several key issues, including the cap on Tehran's future nuclear enrichment program.

At Sunday's meeting the two foreign ministers "discussed both the progress that has been made and the work that still needs to be done," the State Department official said.

"Secretary Kerry noted that this week is an opportunity to make additional progress and stressed that it is our intention to do so."

On Thursday, the senior U.S. official said that over the summer, the six power group had offered "creative solutions" on key issues like enrichment but that Iran hadn't been immediately responsive. However western diplomats have said this week's talks had been more constructive.

Speaking in New York on Wednesday evening, Iran's Foreign Minister Javad Zarif said his side was "committed to resolving this issue." But Mr. Zarif said Iranian trust in U.S. intentions remained low.

Iran, which insists its nuclear program is for purely peaceful civilian purposes, negotiates with the U.S., U.K., France, Germany, China and Russia, the so-called P5+1 Group.

Write to Laurence Norman at laurence.norman@wsj.com

Subscribe to WSJ: http://online.wsj.com?mod=djnwires