He added that Girouard could be paroled after serving about a third of the sentence.
Girouard was leading a squad in May 2006 during a raid on a suspected fighters' camp near Thar Thar lake, southwest of Tikrit, when the incident happened.
He was the last and most senior soldier from the 101st Airborne Division to be tried for the killings.
Three other soldiers under Girouard's command who were also charged with the deaths made plea agreements and were sentenced earlier.
Specialist William Hunsaker and Private First Class Corey Clagett were sentenced to 18 years in military prison. The third got nine months in jail.
Hunsaker testified on Wednesday that Girouard ordered him to kill three Iraqi detainees, then cut him with a knife to make it look as if there had been a struggle.
"They're going to cut the ties, tell them to run, shoot them," Hunsaker quoted Girouard as saying.
Girouard had said he was under orders to kill all men of military age but denied ordering the slayings.
Anita Gorecki, Girouard's lawyer, said that the sergeant never ordered his soldiers to shoot the detainees, but that he did help cover up the killings.
She said: "He realised they killed the detainees, and in that moment, yes, he decided to help his squad members."
The soldiers had previously told investigators they were given rules of engagement by Colonel Michael Steele, the 3rd Brigade commander, to kill all military-age men.
Steele has denied this but invoked his right not to testify.
During an August hearing in Iraq that led to the charges, a witness testified he saw the prisoners trying to run away at full sprint, some with their blindfolds down, when they were shot.
The case is one of a series from the Iraq war in which US military personnel are accused of crimes against Iraqi civilians.