Iraqi parliament recognises Shia militias as an 'official force'
The Popular Mobilisation Forces - known in Arabic as Hashd al-Shaabi - will become Iraq's "back-up and reserve" force for the military and police.
Fighters will have state-sanctioned power to "deter" security and terror threats facing the country, after the paramilitaries took a leading role in the battle against Islamic State group militants.
But this battle has also seen the Tehran-backed militias commit grave human rights abuses against mostly Sunni civilians in territories conquered from IS, and sparked fears of growing Iranian influence in the country.
The legislation, supported by 208 of the chamber's 327 members, was promptly rejected by Sunni Arab politicians and lawmakers who said it was evidence of what they called the "dictatorship" of the country's Shia majority.
"The majority does not have the right to determine the fate of everyone else," Osama al-Nujaifi, one of Iraq's three vice presidents and a senior Sunni politician, told a news conference after the vote.
"There should be genuine political inclusion. This law must be revised."
Sunni lawmaker Ahmed al-Masary said the legislation fuels doubts about the participation of all Iraqi communities in the political process.
"The legislation aborts nation building," he said, adding that the law created a dangerous parallel to the country's military and police.
The law - tabled by the chamber's largest Shia bloc - place the militias under the command of Shia Prime Minister Haider al-Abadi.
It also grants militiamen salaries and pensions that mirror those of the military and the police.
In a statement, Abadi welcomed the legislation and said that the Popular Mobilisation Forces would "cover all Iraqi sects".
This is a thinly veiled reference to the much smaller and weaker Sunni tribal forces who have also been accused of harming civilians.
The vast majority of the force is made up of a variety of Shia militias with around 100,000 fighters. This probably makes them Iraq's most powerful fighting force.
"The Popular Mobilisation will represent and defend all Iraqis wherever they are," Abadi said.
The vote comes at a time when the government is waging a major campaign to dislodge IS from Mosul, Iraq's second largest city and the last major urban centre still controlled by the extremist group.
The Shia militias -most of which are backed by neighbouring Iran - have been bankrolled and equipped by the government since shortly after IS swept across much of northern and western Iraq in 2014.
They played a key role in checking the advance of IS on Baghdad and the Shia shrine cities of Samarra and Karbala in the summer of 2014.
They later helped liberate IS-held areas to the south, northeast and north of Baghdad, standing in for the security forces which largely collapsed in the face of the IS blitz in 2014.
However, their role has somewhat diminished as more and more of Iraq's security forces have regained their strength.
Iraq's Sunni Arabs and rights groups have long complained that the militiamen have been involved in extrajudicial killings, abuse and the theft or destruction of property in areas where they drove out IS.
The militias' commanders, however, deny the charges or insist that the excesses are the work of an isolated few.
Currently, the militias are tasked with driving IS from the town of Tal Afar west of Mosul. They seized the town's airstrip earlier this week. Abadi met militia commanders at the strip on Thursday.
Meanwhile in Mosul, Iraqi military and hospital officials said mortar rounds fired by IS militants overnight and early on Saturday have killed 16 civilians in neighbourhoods already retaken by troops.
Scores of civilians were continuing to stream out of the city's inner neighbourhoods to escape the fighting, making their way to camps for the displaced.
The UN refugee agency, UNHCR, says at least 73,000 Iraqis have fled Mosul since the government's campaign to retake the city began on 17 October.