Melina Boughedir, a mother of four, was sentenced last February to seven months in prison for "illegal" entry into the country and was set to be deported back to France.
But another court ordered the re-trial of the 27-year-old French citizen under Iraq's anti-terrorist law and on Sunday she was found guilty of belonging to IS.
"I am innocent," Boughedir told the judge in French.
Iraq frees suspected French militant who served sentence
"My husband duped me and then threatened to leave with the children" unless she followed him to Iraq, where he planned on joining IS, she said.
"I am opposed to the ideology of the Islamic group and condemn the actions of my husband," she added.
Boughedir, who wore a black dress and a black headscarf, arrived in the courtroom carrying her youngest daughter in her arms. Her three other children are now back in France.
Her sentence is the latest doled out to foreigners who flocked to join IS in its self-declared caliphate after the militant group seized the northern third of Iraq and swathes of Syria in 2014.
On May 22, an Iraqi court sentenced Belgian militant Tarik Jadaoun, also known as Abu Hamza al-Beljiki, to death by hanging -- although he pleaded not guilty to a range of terror charges.
Jadaoun had earned the moniker "the new Abaaoud", after his compatriot Abdelhamid Abaaoud, one of the organisers of November 2015 attacks in Paris.
France warns Iraq against issuing death sentences to European nationals
Even before she was sentenced, Boughedir's case sparked anger from her defence team, who had accused French authorities of interfering in the case.
On Thursday, French Foreign Minister Jean-Yves Le Drian told French news channel LCI that Boughedir was a "Daesh (IS) terrorist who fought against Iraq" and said she should be tried on Iraqi soil.
That prompted her French lawyers to send a letter of protest to Le Drian, seen by AFP, in which they denounced "pressure on the Iraqi judicial system" and "unacceptable interference".
On Saturday, one of her lawyers, William Bourdon, told AFP that Boughedir's family and her defence team want her to return to France and face a court there.
"There is an unprecedented antagonism between the French political establishment and justice," said Bourdon, who had travelled to Baghdad with two other French lawyers to join forces with Boughedir's Iraqi defence attorney.
Arrested in the summer of 2017 in Mosul, the former capital of IS's proto-state, Boughedir was sentenced in February to seven months in prison for "illegal" entry into the country and was set to be deported back to France.
But upon re-examining her file, an Iraqi court found that Boughedir knew her husband was planning on joining IS in Iraq and that she "knowingly" followed him.
During Sunday's hearing which lasted about one hour, the judge asked Boughedir to explain why and under what circumstances she entered Syria and then Iraq.
He then declared that "the proof that has been gathered is enough to condemn the criminal to life in jail".
Boughedir's husband is believed to have been killed during a vast operation by US-led coalition-backed Iraqi forces to seize Mosul, Iraq's second city, back from jihadist control.
Iraq condemns 15 Turkish women to death for belonging to Islamic State
On Sunday she told the court that the man she had been married to for five years had disappeared one day, walking out and saying he was going out "to look for water".
Since then, she said, she had received no information about his fate or his whereabouts.
Boughedir is the second French citizen sentenced to life in prison by an Iraqi court for belonging to IS, after Djamila Boutoutaou, 29, in April.
Boutoutaou also said she had been tricked by her husband.
Thousands of foreign fighters from across the world flocked to the black banner of the jihadists after the group seized swathes of Iraq and Syria in 2014.
Multiple offensives have since reduced their "caliphate" to a sliver of desert territory in the east of war-torn Syria.
Dozens of French citizens suspected of having joined IS ranks are believed to be in detention in Iraq and neighbouring Syria, including several minors.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ