Two masked men invaded the vault of a bank in Ocean City, Md., yesterday, filled three plastic trash bags and a canvas sack with more than $500,000 and fled while firing four shots at a pursuer in one of Maryland's biggest bank robberies in years.

Two suspects were arrested and most of the loot was recovered about seven hours later after the FBI and state and local police surrounded a house in the Ocean Pines development, where a 65-year-old man was being held hostage.

It was not immediately clear why such a large sum of cash was held at the Calvin B. Taylor Banking Co. branch on Ocean Highway when the robbers entered about 9:50 a.m. and ordered a teller in the vault to let them inside.

"It was a real professional operation," said Edward D. Hegarty, special agent in charge of the FBI's Baltimore office. "They knew exactly what they wanted to do."

The robbers, firing at a witness who followed them from the bank, sped away in a car.Its description was given to police, and a vehicle matching the description was later spotted on a nearby highway. Sometime afterward, the car was found abandoned near the Ocean Pines development.

Around 4 p.m. authorities, including an FBI assault team led by Hegarty, laid siege to a single-family house in a wooded, secluded section of the development where they believed the suspects were holding the 65-year-old occupant hostage.

Hegarty called over the loudspeaker on his car for the suspects to surrender, while attempts were made to reach the house by telephone. At least twice, the elderly man answered, insisting that he was alone. Finally, however, Hegarty said, the man "admitted they were in the house and had a gun to his head."

The hostage was not identified.

The FBI said Jacques Joseph Evans, 37, of Berlin, Md., and Mark Stephen Mellett, 29, of Randallstown, Md., were arrested and charged with armed bank robbery.