Alexandria dedicated its new $14.7 million courthouse last week, completing the final project in a controversial 20-year urban renewal program that demolished scores of Old Town buildings to clear the way for office buildings the city hoped would revitalize the center of its historic district.

The courthouse, which is in the back half of a new privately owned office building in the 500 block of King Street, consolidates numerous court offices that had been scattered throughout the city.

The city also has begun a $6 million restoration of its 19th century city hall, two blocks from the new courthouse, which had housed the Circuit and General District courts. City agencies in the hall have been displaced to leased office space and other city-owned buildings until the restoration is completed, expected in 1984.

The new courthouse brought praise from various city and state officials who attended the ceremonies last Friday.

Sheriff Mike Norris said he looked forward to a more secure and orderly courthouse. At the city hall quarters, Norris said, "We had escapes and scuffles, and judges, jurors, witnesses and sometimes defendants would mingle in the halls and even in the restrooms."

The new courthouse has separate entrances, hallways and elevators for judges, defendants and the public.It also has a 307-car underground public parking garage.

The courtrooms in the 4 1/2-story Georgian-style brick building, with entrances through a courtyard facing King Street, have not increased in number, but are much larger.

Retired Circuit Court Chief Judge Franklin P Backus, long a backer of a new court building, praised the Williamsburg-blue, colonial-style courtroom where the dedication was held last Friday, citing in particular its good acoustics. Harry L. Carrico, chief justice of the Supreme Court of Virginia, called the new courthouse "a lovely temple of justice."

"We've talked of a new courthouse for decades," Mayor Charles E. Beatley told the more than 300 guests at the dedication. "We started out in a low-priced era and ended up in an high-priced era."

The courthouse was approved in 1974 by a divided City Council, with Beatley, who was then a council member, opposing it. At the time, the estimated cost was $6 million.By 1979 that had risen to $12 million, before rising to its final cost of $14.7 million.

But the cost was not the most controversial issue surrounding construction of the courthouse. Instead, it was the demolition of historic buildings and then the modernistic design first proposed for the courthouse. The City Council required an early 19th century-style building.

The new courthouse will include the Circuit and General District courts, Juvenile and Domestic Relations courts, offices for the commonwealth's attorney, sheriff, probation and parole offices, the city's law library and the Industrial Commission of Virginia.