SEOUL (Reuters) - President Barack Obama said on Sunday there was still time to resolve the Iranian nuclear standoff with the West through diplomacy but that the window for such a solution was closing.

Obama reiterated his position on Iran after talks with Turkish Prime Minister Tayyip Erdogan on the eve of a nuclear security summit in Seoul.

"I believe there is a window of time to solve this diplomatically but that window is closing," Obama told reporters.

Tehran says its nuclear programme is purely peaceful, but Israel and Western nations believe it is moving towards a nuclear bomb that could change the regional balance of power.

Obama has pressed Israel to hold off on any attack on Iran's nuclear sites to give sanctions and diplomacy time to work. But he has said military action remains an option if all else fails.

Erdogan spoke to Obama of his planned visit to Iran before the end of the month and said he would also talk to Iranian leaders about the violence in Syria, an ally of Tehran, a senior U.S. official said.

Iran and North Korea are not on the guest list or the agenda for the Seoul summit, but their nuclear standoffs are dominating talks on the sidelines of the conference that is ostensibly focused on preventing nuclear terrorism.

Obama has spearheaded international efforts to isolate Tehran, which include several rounds of sanctions, but it has remained defiant on its nuclear programme, despite showing an openness to possibly resuming long-suspended talks with world powers.

(Reporting by Alister Bull and Matt Spetalnick; Editing by Nick Macfie)