GENEVA — As Secretary of State John Kerry and foreign ministers from other world powers sought to work out an interim agreement to constrain Iran’s nuclear program, the Iranian government’s insistence on formal recognition of its “right” to enrich uranium emerged as a major obstacle, diplomats said Sunday.

In long hours of closed-door discussions, Western and Iranian negotiators haggled over the language of a possible agreement. Toward the end of a marathon session, some diplomats believed that only a handful of words appeared to separate the two sides.

But the dispute over enrichment rights, among other differences, meant that the talks ended not with the breakthrough that many had hoped for, but with only a promise that lower-level negotiators would meet here in 10 days for more discussions.

Many reports have ascribed the failure of the talks to France’s insistence that any agreement put tight restrictions on a heavy-water plant that Iran is building, which can produce plutonium.