Iraq disbanded its National Olympic Committee (NOC) in May because of a dispute over how it had been assembled.
The IOC gave Iraq a deadline to reinstate the committee, but the government had
refused to back down.
Basil Abdul Mahdi, an adviser to the ministry of youth and sport, said last week there would be "no retreat" in Baghdad's decision to replace the disbanded Olympic committee.
The stance prompted concern that Iraq would not be represented in Beijing.
But Pere Miro, head of the IOC's department for relations with national Olympic committees, said: "The national Olympic committee will have fair elections before the end of November.
"Until then, Iraq's Olympic organisation will be run by an interim committee proposed by its national sports federations and approved by the IOC."
After signing the agreement in front of journalists, Ali al-Dabbagh, Iraq's government spokesman, said:"We want to forget all the past.
"We want to have real representation for the Iraqi teams and the Iraqi supporters."
|Iraq disbanded its national Olympic committee in May [AFP]
Ahmed Tabour, head of the Iraqi cultural and sports committee in Switzerland, said his country was being treated unfairly by the IOC.
"Iraq was never suspended during the days of Saddam [Hussein], who personally appointed the national Olympic committee," he said.
"The Iraqi people need hope, and sport gives them a lot of hope."
The IOC last suspended Iraq in May 2003 - weeks after US-led troops toppled Saddam's government.
That ban occurred after the IOC learned of the abuse of athletes by Saddam's son Uday, the country's former Olympic chief.
The suspension was lifted a year later, allowing Iraq to take part in the 2004 Summer games in Athens where it fielded a team of 25 athletes.
Iraq's soccer team made it to the semifinals, prompting celebrations throughout a country where violence has claimed the lives of athletes, coaches and staff.
The Olympic cycling coach, national wrestling coach, a soccer federation member and a prominent volleyball player have been killed, most in 2006, during the height of sectarian slayings.
Emmanuelle Moreau, an IOC spokeswoman, said the two athletes who will represent Iraq this year have benefited from an IOC solidarity programme that allowed them to train at sports facilities abroad, IOC spokeswoman said.
Although the duo failed to meet the qualifying standards to go to Beijing, they were allowed to take part under the IOC's wild-card programme designed to ensure every country is represented at the games.
"Sport is really important for us in Iraq right now," he said. "It brings the people together," al-Dabbagh said.
Iraq has won only one bronze medal since its first appearance at the summer Olympics in 1948.