* Kerry, Zarif see progress, but tough issues remain
* Talks set to run until July 7, but could go longer
* China and Russia optimistic on prospects for deal
* Concerns still remain over Iran's past activities (Adds second U.S. official says talks could run past July 7 if near a deal, paragraph 12)
By John Irish and Louis Charbonneau
VIENNA, July 3 (Reuters) - A year and half of nuclear talks between Iran and major powers were creeping towards the finish line on Friday as negotiators wrestled with sticking points including questions about Tehran's past atomic research.
Iran is in talks with the United States and five other powers - Britain, China, France, Germany and Russia - on an agreement to curtail its nuclear program in exchange for relief from economic sanctions.
"We are coming to the end," said a senior Western diplomat, who added there was no plan to carry on for long past next Tuesday. "Either we get an agreement or we don't."
Iranian Foreign Minister Mohammad Javad Zarif said a deal was close.
"We are ready to strike a balanced and good deal and open new horizons to address important common challenges," he said in a statement broadcast on YouTube, referring to the rise of Islamist militancy.
"We have never been closer to a lasting outcome."
U.S. Secretary of State John Kerry said there was more work to be done but parties were making an effort.
"We are making progress," Kerry said.
All sides say a deal is within reach. U.S., European and Iranian officials, including U.S. Under Secretary of State Wendy Sherman and Iranian deputy foreign ministers Abbas Araqchi and Majid Takhteravanchi, held a six-hour negotiating session that ended at 3 a.m. on Friday, a senior U.S. official said.
Russia's chief negotiator Sergei Ryabkov said the text of the agreement was more than 90 percent complete. Chinese Foreign Minister Wang Yi voiced confidence that the parties would reach a mutually acceptable accord.
The negotiators missed a June 30 deadline for a final agreement, but have given themselves until July 7, and foreign ministers not already in Vienna are due to return on Sunday for a final push.
"Then ... we are really in the end game of all of this," said a second senior U.S. official, saying it was conceivable the talks could run past July 7 if they were on the verge of a final agreement.
A deal, if agreed, would require Iran to severely curtail uranium enrichment work for more than a decade to ensure it would need at least one year's "breakout time" to produce enough highly enriched uranium for a single weapon, compared with current estimates of two to three months.
QUESTIONS ABOUT IRAN'S PAST
Western and Iranian officials said there were signs of a compromise emerging on one of the major sticking points: access to Iranian sites to monitor compliance with a future agreement.
Another potential compromise emerging relates to Iran's low enriched uranium stockpiles. Western and Iranian diplomats said Tehran was considering shipping most of the stockpile out of the country, something Tehran had previously ruled out.
A senior Iranian official in Vienna said on Thursday that Iran would sign up to an IAEA inspection regime called the Additional Protocol, which would be provisionally implemented at the start of a deal and later ratified by Iran's parliament.
The Protocol allows IAEA inspectors increased access to sites where they suspect nuclear activity is taking place, but U.S. officials say it is insufficient because Iran has in the past stalled by dragging out negotiations over access requests.
The Iranian official said Iran could also agree to a system of "managed access" - which is strictly limited to protect legitimate military or industrial secrets - to relevant military sites.
Iran's Supreme Leader Ayatollah Ali Khamenei, who has the power to block a deal, last week ruled out either a long freeze of sensitive nuclear work or opening military sites to inspectors.
A Western diplomat told Reuters: "The positions set out by Khamenei last week make it more difficult to bridge the gaps in the next few days, and there is still work to be done."
The issue of Iran's past nuclear research is also difficult.
Yukiya Amano, head of the International Atomic Energy Agency (IAEA), on Thursday met Iranian President Hassan Rouhani and other officials in Tehran to discuss the IAEA's unresolved questions.
But on Friday he said in a statement that there had been no breakthrough and "more work will be needed."
Western diplomats said they were not demanding a public confession that Iran had conducted research into building a nuclear warhead, but that the IAEA had to be satisfied it knew the full scope of past Iranian activity to establish a credible basis for future monitoring.
Officials close to the Vienna talks say the suspension of some sanctions will be tied to resolving this issue. "It's time to close this chapter," the senior Western diplomat said.
Other sticking points include the timing of the suspension of sanctions, and Iranian acceptance of a plan to restore U.S., European Union and United Nations sanctions if Tehran fails to comply with the terms of the agreement. (Additional reporting by Parisa Hafezi, Arshad Mohammed and Shadia Nasralla; Writing by Louis Charbonneau; Editing by Kevin Liffey and Anna Willard)