Former Army private Duncan Aston told the Al-Sweady Inquiry yesterday he also saw a fellow private stamp on the head of a dead Iraqi, and other comrades punch and kick a detainee.
He said he did not report the incidents as he did not want to "grass" on his friends.
The inquiry, which is looking into alleged abuses of detainees by UK soldiers and claims some were unlawfully killed, heard a sergeant emptied a magazine into the bodies of Iraqis during the battle of Danny Boy on May 14, 2004.
Mr Aston, who was serving with the 2nd Battalion the Princess of Wales's Royal Regiment (2PWRR), said his platoon sergeant demanded his weapon from him then opened fire on the bodies.
Members of the regiment and soldiers of the Sutherland Highlanders and Prince of Wales Royal Regiment were sent to help the group involved in the fighting.
Mr Aston, who had since left the Army, also described seeing a fellow private stamp on the body of a dead Iraqi, and other comrades kick a detainee while he was held in a derelict building on the battlefield.
The Al-Sweady Inquiry is examining allegations that British troops mistreated and unlawfully killed Iraqi detainees after the Battle of Danny Boy in southern Iraq in May 2004.
It is claimed that 20 or more Iraqis were unlawfully killed at Camp Abu Naji (CAN) near Majar-al-Kabir on May 14 and May 15, 2004, and detainees were ill-treated there and later at Shaibah Logistics Base.
However, the Ministry of Defence has denied the allegations, saying bodies handed back to Iraqis had died on the battlefield and been taken back to CAN.
Mr Aston told the inquiry he was sent from nearby Camp Condor after a "rover group" was ambushed as it travelled to CAN.
In a witness statement to the inquiry he described how, after a firefight with Iraqi insurgents, he was collecting weapons from dead gunmen in a ditch when he noticed two were "twitching".
He said: "At the time, I assumed that because they were twitching this meant there must be some life there."
He said the men appeared to be "somewhere between life and death" but looked past the point of first aid.
Mr Aston recalled his platoon sergeant, Paul Kelly approach the ditch looking very angry and trying to fire at one of the twitching men, but his weapon did not work.
He said: "He then threw his rifle to the ground and said words to the effect of 'give me your weapon'."
He said Sgt Kelly seemed worked up. He added: "He had been injured earlier in the tour when he was shot in the finger and he had returned to Iraq after a spell in the UK a lot angrier than he had been before."
He assumed Sgt Kelly wanted to fire his rifle at the bodies, but did not feel he could say no, Mr Aston told the hearing in central London.
He said: "He put a full magazine of bullets into both bodies that had been twitching but he also fired into the bodies of the other dead gunmen in the ditch.
"The bodies of the two twitching gunmen stopped twitching. There was no other reaction from the bodies. They did not make any other noise, they just stopped twitching."
Sgt Kelly gave the gun back, and the incident was not mentioned between them again, he said.
He said one other private, James Lawrence, witnessed the incident. The men later spoke about it but agreed not to report the incident.
The inquiry was adjourned until today.