WASHINGTON — An Army program meant to increase the number of recruits during the Iraq and Afghanistan wars devolved into an illegal free-for-all that could cost taxpayers close to $100 million, military investigators say, describing new details of what they called a long-running scheme among National Guard recruiters that went undetected for years.

Army officials appeared before a Senate hearing on Tuesday and sketched out a huge criminal endeavor that has implicated more than 1,200 people — 200 of them officers — including two generals and dozens of colonels. Criminal investigators for the Army said soldiers, civilians and National Guard recruiters had used the program as a “bounty” from which they could illegally collect money for recruiting soldiers they had not recruited.

Senator Claire McCaskill, Democrat of Missouri and chairwoman of the Senate panel holding a hearing, was visibly irate and repeatedly expressed anger and surprise as she listened to Army investigators describe the fraud they say took place under a program that began in 2005 at the height of the Iraq war to address an enlistment shortfall in the Army National Guard.

Under the program, National Guard soldiers — and their relatives, as well as other civilians and retirees — signed up to be recruiting assistants and could earn up to $7,500 for each new recruit they managed to enlist. But investigators said that in many cases, high school guidance counselors and even principals with access to their students’ personal information took credit for recruiting students who they happened to know were joining the Army.