Charles J. Walsh, a Georgetown accountant who fled to Ireland after becoming the target of a federal investigation, was sentenced here yesterday to seven years in prison in connection with two fraudulent tax-shelter schemes.

The bearded, 37-year-old Walsh, described by prosecutors as a flamboyant "confidence man" who defrauded about 500 investors out of $3.3 million, wore a dark blue suit and seemed subdued as he appeared before U.S. District Judge Gerhard A. Gesell for sentencing.

In a plea bargain arrangement, Walsh returned here from Ireland a month ago and pleaded guilty to one count of wire fraud and one count of false pretenses. Prosecutors dropped 48 other charges against him.

After Walsh said he "acknowledged my wrongful conduct" and that he was "prepared to accept the sentence of the court," Gesell declared that he would impose a "straight punishment sentence" of just one year fewer than the maximum allowed.

"Everything before me indicates that there was a deliberate series of offenses over a series of years, intricate and skillfully concealed," Gesell said. "You masterminded it. You dragged other people into it."

In a statement later, U.S. Attorney Joseph E. diGenova said he hoped the sentence "will send a message to those who might be contemplating operating similar fraudulent and abusive tax-shelter programs. The United States will vigorously prosecute them and seek substantial periods of incarceration."

Papers filed before sentencing by Assistant U.S. Attorneys Carol E. Bruce and Paul N. Murphy said the government spent $6 million investigating the case and lost a total of $10.6 million in "bogus tax credits and deductions" claimed by investors in Walsh's tax shelters.

The two counts to which Walsh pleaded guilty involved the American Container Management leasing program and the Vanguard Bond Fund Program.

The prosectors' memo said Walsh funneled most of the funds he obtained through a bank he created in Montserrat in the British West Indies called the "British Overseas Bank." They said the bank "existed only on paper," and had only a "mail drop and answering service" in New York.

The shipping container scheme, which prosecutors described in their memo as Walsh's "masterpiece," was set up through a "network of allegedly 'independent' companies, which he secretly established and controlled," prosectors said. The containers, which Walsh valued at $80,000 each, actually were scrap, for which Walsh paid $1,000 each, and were "left to rot in storage lots, where they remain today," the memo added.

Walsh fled to Ireland after prosecutors discussed a plea bargain with him in December 1983, the U.S. attorney's office said, and he lived there as an "opulent . . . country squire" until his arrest in December 1984, a day after an extradition treaty took effect. He fought extradition until he lost in an Irish court, prosecutors said.

Yesterday, defense attorney Plato Cacheris described Walsh as a "brilliant [accountant] who succumbed to the illness of greed."