Two District of Columbia undercover policemen were shot and a suspect was seriously wounded in a shootout yesterday during an apparent armed robbery attempt at a downtown jewelry store being staked out by police.

Police said the two officers, one posing as a customer and the other as an employe, were wounded when a gunman unexpectedly opened fire inside The Wedding Ring Store, which is located behind electronically controlled doors in the basement of a four-story building at 1909 I St. NW.

The two policemen and a third officer stationed inside the store returned the fire, and at least three bullets struck the gunman, police said. He fled, wounded, down I Street and was knocked down and captured by officers at the intersection of 19th and I streets. An alleged accomplice, who was apparently unarmed and not injured, was captured in the store by the third undercover officer, police said.

Officer James T. Bovino, 32, a six-year veteran, was shot in the abdomen and was in satisfactory condition last night at George Washington University Hospital following two hours of surgery, police reported. Officer Andrew Merranko, 33, a 12-year veteran, suffered a superficial head wound and was hospitalized in good condition.

The wounded suspect, identified as Herbert Douglas, 18, of 719 13th St. NW, was under police guard last night at the same hospital, where he was listed in serious condition with wounds in the hand, groin and abdomen. He and a second suspect, Jerome Fields, also 18, of 4230 Livingston Rd. SE, have each been charged with two counts of assault with intent to kill a police officer.

Yesterday's drama, unfolding shortly after 3 p.m. along one of the city's busiest streets, sent horrified onlookers scrambling for cover and brought shop clerks and office workers rushing to their windows to investigate the gunfire.

Sally Snyder, who works in the J & M Shoe Repair and Dry Cleaning shop across from the jewelry store, said she was standing in the doorway when she heard gunshots.

"I saw this guy running out of the store and down the street. Two men were after him. One fell down at the steps outside the store . The other ran and chased the guy.

"It was scary," she said. "I told the people in the store to get down because they were shooting outside." She said there was a man who had just finished parking his car (on I Street) when the gunfire started. "He ducked behind the car," Snyder said.

The confrontation had been building throughout the afternoon with police on special alert because of three bank robberies -- apparently unrelated -- that had occurred in the area in the morning and a tip given police by the store owner that two suspicious persons had visited the store earlier in the day.

Police and witnesses gave the following account of the incident:

Shortly before 3 p.m. one of the store's co-owners, Barry Michaelson, noticed two men banging on his locked door. Michaelson recognized one of the men as someone who had tried several times before to gain entrance to the store.

The shop specializes in custom-made wedding rings and ordinarily sees customers by appointment only. Admittance to the store can be gained only if someone inside opens the electronically controlled door.

Michaelson called his brother, Neil, who works at the family jewelry store nearby. Neil said Barry told him that the men did not look like his usual customers.

"He said he had been seeing one of the men for days, and he was poorly dressed, and when he noticed another man with him he wasn't about to let him in," Neil Michaelson recalled.

Neil quoted his brother as saying that one of the men shouted through the door that he wanted a wedding ring made for his marriage in a week. Told that that would be impossible, the visitor then said he would change the wedding date. He said he would be back shortly to buy the ring, and the two left.

On the advice of his brother, Barry Michaelson telephoned the police robbery squad, which was investigating the bank robberies. Two squad detectives were dispatched to the store, but left after advising Michaelson to summon police immediately if the men came back.

At that moment, however, and unknown to either the detectives or Michaelson, five undercover officers from the 2nd Police District had the suspects under surveillance, having been alerted to the bank robberies and having noticed that the two were acting suspiciously.

After the two men left the store the first time, the officers approached Michaelson, who told them of the suspects' intention to return and agreed to the stakeout. Bovino and Merranko then assumed the roles of employe and customer, and a third officer, Ann McGinnis, hid inside the store behind a pane of bulletproof glass. The two other officers, Walter A. Dandridge and Rodney D. Monroe, stationed themselves outside.

Within a half-hour, the two men returned and were admitted to the store. Then one drew a gun and shouted, "Freeze."

The officers identified themselves and went for their revolvers, police said. Gunfire erupted and at least seven shots were fired inside the store. Both wounded officers and McGinnis shot at the gunman. He fled and the wounded officers gave pursuit. McGinnis captured the unarmed suspect inside the store.

The two wounded police officers, joined by Dandridge and Monroe, began firing at the fleeing suspect. One of the wounded officers collapsed outside the store at the top of the steps leading to the entrance.

Fred Walker, who was inside the Pan Mar Wine and Liquor store across from the jewelry store, said the wounded suspect "hauled out of the store and just before he got to the intersection [of 19th and I streets NW], they [officers] had him down [on the ground].