A U.S. Navy investigator testified Wednesday that a U.S. Marine accused of rape said he had consensual sex with his Filipino accuser while three other servicemen cheered him on.

Lance Cpl. Daniel Smith "admitted he had sexual intercourse with the Filipino woman inside the van and that the other Marines cheered him on," U.S. Naval Criminal Investigation Service agent Guy Papageorge testified, reading from his investigative report.

Papageorge said when he asked Smith if it was consensual sex, the Marine answered, "Yes, it was consensual." The investigator also said Smith told him he used a condom.

Papageorge and Ronald Veltz, another Navy investigator, appeared in court after the U.S. Embassy agreed to let them testify for the prosecution in the trial of the four Marines, reversing an earlier decision that threatened to derail the proceedings.

Last week, the embassy caused a stir by saying diplomatic immunity prevented Navy investigators from testifying. Prosecutors accused U.S. officials of holding up the proceedings, and the judge gave U.S. officials until Wednesday to allow the witnesses to appear in court.

The trial has stirred strong emotions in the former American colony, with a handful of anti-U.S. protesters regularly shouting slogans and carrying signs outside court.

Prosecutors allege Smith raped the woman inside the van, while Lance Cpl. Keith Silkwood, Lance Cpl. Dominic Duplantis and Staff Sgt. Chad Carpentier watched. The Marines had just finished counterterrorism maneuvers with Philippine troops.

The rape charges are punishable by up to 40 years in prison. The Marines have refused to answer the charges, and the judge entered a plea of innocent for them.

Papageorge said Smith told him he met the 22-year-old woman in a bar at the former U.S. Naval Base in Subic Bay, near Olongapo city, west of Manila, on the night of Nov. 1, when the alleged rape took place.

CountryWatch: Philippines

Carpentier told investigators he saw Smith and the woman dancing, and later kissing as the woman sat on Smith's lap, Papageorge testified.

Evalyn Ursua, the woman's lawyer, said earlier that Smith's admission of having had sex with the woman was an important boost to the case against the Marines, and that Smith would need to prove his claim it was consensual sex.

Prosecutors and several witnesses had testified earlier that the woman was drunk when she was carried by Smith on his back into the van.