In addition, at least one soldier was injured when a U.S. vehicle hit an explosive in part of the capital believed to have been cleared of land mines.
The incidents demonstrate Iraq is still fraught with danger for U.S. forces a month after Saddam Hussein's government fell.
In Washington, Gen. Tommy Franks, the U.S. commander of the war in Iraq, commented on the latest casualties. He said he expects to see more such "rough behavior in this country for the foreseeable future."
But he added that U.S. and coalition forces are up to the task and will continue to do their jobs.
In the most brazen attack, an unidentified Iraqi walked up to a soldier on a bridge and opened fire with a pistol at close range, according to senior U.S. Army officers in Baghdad who had heard reports of the shooting.
The officers said the slain soldier, whom they did not identify, belonged to the 2nd Armored Cavalry Regiment from Fort Polk, La. Calls to that regiment's public affairs officer here went unanswered Thursday night.
No further information was immediately available, and it was unclear what happened to the assailant. U.S. Central Command in Qatar said it was unaware of the incident.
U.S. forces say they trade fire with armed Iraqis almost daily across the country. Still, an incident like the one on the bridge is highly unusual even in postwar Iraq.
In the second attack, a U.S. Army 3rd Infantry Division soldier was killed when a sniper shot him in the head in east Baghdad, said Capt. Tom Bryant, spokesman for the Army's V Corps, which is based at Baghdad's airport. He had no further details.
Also Thursday, an American Humvee hit a "probable land mine" while crossing a median in a road near Baghdad's airport, Bryant said. Details were sketchy, but at least one U.S. soldier was injured in that incident.
Earlier, Bryant said, a group of children motioned to a military convoy traveling down another road about a quarter-mile away to avoid a plastic bag in the street. The convoy followed their advice, but an Iraqi truck coming up behind the convoy ran over the bag and it exploded.
The driver of the truck escaped injury, but an Iraqi man standing nearby suffered burn and shrapnel wounds. He was taken to a U.S. field hospital and was reported in shock.
Other incidents have bedeviled U.S. forces in recent days, though none cause casualties.
On Wednesday, the military said, two Iraqis shot at reconnaissance elements of the 3rd Infantry Division with small arms and rocket-propelled grenades as they traveled north of Baghdad. The unit returned fire, the military said, killing one assailant.
Also Wednesday, near the northern town of Baiji, a convoy from the 4th Infantry Division came under rifle and machine-gun fire. The unit attacked the assailants' positions and captured five suspects and their weapons, Central Command said. No Americans were injured.