WASHINGTON — A lawsuit filed in federal court on Tuesday contends that major American corporations doing business with the Iraqi government during the Iraq War also provided it with free drugs and medical devices that became an important source of funding for a Shiite militia that targeted United States troops.

The lawsuit was filed on behalf of members of the American military who were injured or killed by attacks between 2005 and 2009, at the height of the Iraq War. It accuses five companies — American firms General Electric, Johnson & Johnson and Pfizer and European drugmakers AstraZeneca and Roche Holding A.G. — of winning contracts to sell their products to the Iraqi Ministry of Health with the understanding that they also provide additional medical supplies and medicines for free.

At the time, the health ministry was controlled by followers of Moktada al-Sadr, a firebrand cleric and the leader of the Mahdi Army, whose death squads against Iraqi Sunnis also brought the country to the brink of civil war. The lawsuit claims Mr. Sadr’s lieutenants sold the samples on Iraq’s black market to fund their attacks on American forces.

As evidence, the lawsuit cited contracts between the companies and the Iraqi government, leaked diplomatic cables, press accounts and the testimony of informants. It was filed in United States District Court in Washington by lawyers from of a start-up firm led by Ryan Sparacino, who has been investigating the allegations for more than a year, and the litigation firm of Kellogg Hansen.