Alexandria Mayor Charles E. Beatley's defeat yesterday by his former protege, former vice mayor James P. Moran Jr., ended a period during which Beatley oversaw the total reshaping of the city's waterfront.

Beatley, a 68-year-old retired airline pilot who left his native Ohio as a young man to fly commercial airplanes in Peru, became part of the Alexandria political scene in l958, when he lost a City Council race. He portrayed himself as an outsider who would break the hold of what some considered a network of developers and lawyers influential in the city government.

He was elected to the council in l966 and became mayor in l967, a post he held until l976. After a three-year break, he again was elected mayor in l979.

Beatley, who came in as an outsider, has been criticized recently by those who feel that his long tenure made him part of an entrenched group that was not responding to the city's problems in innovative ways.

The Beatley-led commercial development that transformed downtown Alexandria into what some consider one of the most attractive spots in the metropolitan area has also brought new problems -- lack of housing for low-income groups and one of the highest tax rates in the area.

A tall, twinkly-eyed man with a white crew cut, Beatley was a familiar figure who often walked the city streets, usually while eating an ice cream cone. He lives in Alexandria, but also runs a glider school on his 300-acre farm in Warrenton, Va.

He worked the hours of a full-time mayor in spite of his part-time salary of $12,500. The former United Airlines pilot and grandfatherly mayor was determined to bring new business to the city and develop star tourist attractions such as the Torpedo Factory arts center and the revitalized waterfront as well as a new city bus system.

Beatley was fond of saying he wanted to govern by consensus, and as a consequence he presided over long, rambling City Council meetings described by one coucil member as "much like a family dinner." Some nights Beatley would sit in his high-backed chair with his eyes closed as debates droned on. But just as observers expected to hear a snore, he would open his eyes and take the discussion in hand.

Behind the folksy manner is a shrewd politician who prided himself on running a clean city government that would not tolerate what he considered corruption.

It was in that vein that Beatley led the advance against Public Safety Director Charles T. Strobel when allegations surfaced that Strobel had inappropriately ended a city police drug investigation in l984. The mayor's aggressive pursuit of administrative action against Strobel backfired last February, when a special grand jury reported it found no basis for those allegations.

The grand jury report was considered by many to be a turning point in Beatley's campaign for reelection. The mayor, who said last December he would "welcome some opposition" in the race, faced a well-financed campaign by Moran that constantly reminded voters of the Strobel incident.

Beatley told his supporters last night ". . . I'm philosophical about things. I wouldn't do things any different. We were just out-gunned in more ways than one."

Is his final retirement from city politics at hand? He said he would stay close to politics, but not as a candidate.