The UN Security Council has passed a resolution giving Iran a month to suspend uranium enrichment or face possible sanctions.
Iran says its nuclear programme is entirely peaceful
The resolution was passed by 14 votes to one, with Qatar the lone dissenter.
The resolution says "appropriate measures" will be taken if Iran does not comply, but does not threaten the immediate imposition of sanctions.
Iran's ambassador to the UN, Javad Zarif, angrily rejected the move.
The US and other nations accuse Iran of trying to develop nuclear weapons, but Iran says its motives are peaceful.
"Iran's peaceful nuclear programme poses no threat to international peace and security and therefore dealing with this issue in the Security Council is unwarranted and void of any legal basis or practical utility," Mr Zarif said, according to Reuters news agency.
The draft resolution was negotiated over the past two weeks by the five permanent Council members - the US, UK, China, France, Russia - as well as Germany.
It follows a 12 July agreement to refer Iran to the UN Security Council for failing to respond to a package of energy, commercial and technological incentives to suspend enrichment. Iran has said it will respond to this package by 22 August.
Resolution 1696 gives Iran until 31 August to suspend uranium enrichment and open its nuclear programme to international inspections.
SECURITY COUNCIL MEMBERS
Permanent: China, France, Russia, UK, US
Temporary: Argentina, Republic of Congo, Denmark, Ghana, Greece, Japan, Peru, Qatar, Slovakia, Tanzania
If it does not comply, the council would consider adopting "appropriate measures" under Article 41 of Chapter 7 of the UN Charter, which relates to economic sanctions.
Russia and China argued against the specific mention of sanctions, and say the Council will have to hold further discussions on what steps to take should Iran fail to meet the deadline.
But both want Iran to accept what is on offer and prove to the world that its nuclear programme is aimed at generating electricity, not building bombs, says the BBC's Daniel Lak at the United Nations.
The US says it does not believe Tehran's assertions and has pushed for tough international action, says our correspondent, and the US ambassador to the UN John Bolton welcomed the vote.
"This is the first Security Council resolution on Iran in response to its nuclear weapons programme, reflecting the gravity of this situation and the determination of the council," he said.
"We hope this resolution will demonstrate to Iran that the best way to end its international isolation is to simply give up the pursuit of nuclear weapons."
The UN ambassador for Qatar - the only Arab nation with a seat on the Security Council - said the Council's demands were legitimate but the timing was wrong.
"We do not agree with the resolution at a time when our region is in flames," Nassir Abdulaziz Al-Nasser said.
Iran is a signatory to the Nuclear Non-Proliferation Treaty (NPT), but points out it is entitled to pursue nuclear power generation within the terms of the treaty.