The chief prosecutor had a hankering for rocky road ice cream, and the former state lawmaker wanted vanilla. So after a hot day of campaigning, Prince George's County State's Attorney Glen F. Ivey and former delegate Rushern L. Baker III pulled into a District Heights ice cream shop.

Standing in line outside the Tasty Creme shop on Marlboro Pike on Saturday afternoon, the political leaders who have railed against random violence in the county experienced a bit of it firsthand.

There was a sound like an air pump being activated. Then, pinging sounds. Then the sting. Pellets, fired by a gunman in a car, struck Baker and Ivey and rebounded off a plexiglass window, witnesses said.

"It clearly sounded like somebody had either shot at us or that glass was breaking," said Baker, who gave up his House seat to run unsuccessfully for county executive. "I felt something hit the back of my leg. . . . And that's when I turned to the [father] who was standing at the window, and we looked at each other and said, 'We didn't just get shot at, did we?' "

Ivey felt his arm stinging and saw a trickle of blood.

Prince George's police said they have made no arrests in the case but have advised officers to look for a silver, four-door Mitsubishi Gallant believed to be involved in a pellet shooting that afternoon in the parking lot at FedEx Field. Authorities said two black men were in the car during that incident, which came as the stadium was hosting a football game between Virginia Tech and top-ranked University of Southern California.

Ivey was hit in the upper left arm but was not seriously injured. He received a tetanus shot and had X-rays taken the next day as a precaution. Baker was hit in the leg but was uninjured. Nobody else was hurt.

The shooting at the ice cream shop was a jolting lesson for two men who have pledged to combat such violence. Ivey, 42, had prosecuted crimes as an assistant U.S. attorney in the District before being elected state's attorney in 2002. Baker, 45, a lawyer, spent four years as a member of the Maryland House of Delegates Judiciary Committee, often working on juvenile justice reform initiatives geared to giving teenagers an alternative to violence. He also was involved in the effort to reform Prince George's County schools. Both men have young children.

"It was clearly a reminder of how difficult it must be for people who live in neighborhoods where there is a lot of violent crime," Ivey said. "Just the thought of having to keep an eye out for cars as they drive by, I could see how that could really wear down people. The anxiety of that would be tough to deal with on a day-to-day basis.

"I was aware of that intellectually before, but this was a powerful reminder," he added. "Fortunately, I was blessed that this wasn't real ammunition or a real firearm, but it could have been."

Only hours earlier, Ivey had been discussing programs to stem youth violence in Prince George's with Del. Barbara A. Frush (D-Prince George's). Then, he and Baker headed to Calvert County, where they passed out leaflets and campaigned for Democratic presidential nominee John F. Kerry at a festival in North Beach. The two were heading to a Prince George's effort to turn out the vote for Kerry.

On the way home, traffic on the Capital Beltway forced them off near District Heights, and they decided to stop by the Tasty Creme.

It was about 5:30 p.m., and the pair stood in line with several residents. In front of them, a father was trying to soothe his 10-year-old daughter because she was upset that her banana split had been sprinkled with nuts, Baker recalled.

"The scary thing was that a 10-year-old girl had been standing near us who could have been hit," Baker said. "Who would shoot into a group with a little girl in it?"

A 17-year-old boy working behind the counter was shocked as well.

"I was just serving ice cream to a customer when I heard taps on the window," Eric Green said. "It was three taps. It hit the man in his arm. It was bleeding. . . . I didn't know people around here would do that."

Tania Green of District Heights, who is no relation to Eric, said she deliberately went to purchase ice cream this week to show support for the shop, which she has patronized for 20 years. "This is a landmark," she said. "I was scared to come here today, but hopefully my coming will be a light that will keep others coming."

Jordan Bolder enjoys a treat at the Tasty Creme in District Heights.