(CNN) -- Iran and the group known as the P5+1 have agreed to a four-month extension of negotiations toward a final comprehensive nuclear deal, two Western diplomats told CNN.
The P5+1 includes Germany and the permanent members of the U.N. Security Council: the United States, Russia, China, France and Britain.
Talks between world powers and Iran over that country's nuclear program are "a historic opportunity for all of us to end a rather prolonged chapter," Iranian Foreign Minister Javad Zarif told CNN's Christiane Amanpour in Vienna.
A Sunday deadline was looming for negotiators to reach agreement on a comprehensive solution on Iran's nuclear program; Iran, in return, was seeking broad sanctions relief and access to international markets.
The objective, Zarif said, "is to ensure that Iran's nuclear program will always remain peaceful. I think that is scientifically possible. It doesn't require arbitrary red lines, arbitrary numbers. You just need to find scientific ways of making sure that Iran's nuclear program addresses a practical need. And that is what we have put on the table."
U.S. Secretary of State John Kerry lauded the progress that both sides have made in negotiations but said that "very real gaps" still exist in some areas.
"Diplomacy takes time, and persistence is needed to determine whether we can achieve our objectives peacefully," Kerry said Friday. "To turn our back prematurely on diplomatic efforts when significant progress has been made would deny ourselves the ability to achieve our objectives peacefully."
Some analysts say, however, that a speech by Iranian Supreme Leader Ayatollah Ali Khamenei last week may have set just the kind of red lines that Zarif says should have no part in negotiations.
Khamenei reiterated that he had faith in Zarif and his negotiating team but also said Iran must boost its enrichment capacity, according to Reuters.
In Iran, residents had a mixed reaction to the extension.
Fariba Gholizadeh, a graphic artist in Tehran, blamed Western powers for the failure to reach an agreement.
"It's the West that's trying to impose it's will on us," she said. "Our position is clear. Why should we give up something that's our right, something other countries can have, according to international law."
Engineering student Mohamad Bagherzadeh said he still hopes the two sides can work out their differences in four months.
"Just the fact that they're talking and exchanging ideas is a good thing and it has people much more hopeful for a better future," he said. "I think some extra time gives them the opportunity to come to an agreement."
CNN's Reza Sayah contributed to this article.