Fed by increased demand for business aid and legal advice, the service industry in the Washington metropolitan area grew a stunning 251 percent between 1977 and 1982, according to a report released this month.

That means the area increased its annual service-business revenue from $4.9 billion to $17.3 billion in the relatively short span of five years. It also means that Washington outpaced the nation in the growth of service enterprises.

Metropolitan Boston came in a distant second, trailing metropolitan Washington by 32 percentage points, according to a new report published by the Greater Washington Research Center.

The center is a nonprofit membership organization, partly funded by local business. In operation for 25 years, the center publishes periodic reports on regional economic developments.

What is remarkable about the Washington area's service growth is that it occurred during a period when both Democratic and Republican presidential administrations were reducing government programs and hiring, said George Grier, who along with his wife, Eunice, wrote the report.

"A lot of people felt that if government was being cut back, the service industry would be one of the sufferers. But, in fact, that just didn't happen," Grier said.

Business services, the area's single largest service sector with 30 percent of the market, grew rapidly as a result of rising dependence on computers and the "temporary-help" industry.

Associations, the so-called membership-services sector, remained robust with a 14 percent share of the market. Legal services finished third with 11 percent of the market. Health services took 9 percent.

Why so much in legal fees? It's difficult to operate in Washington without a lawyer, Grier said. You want to reduce the federal work force? Check with the lawyers in personnel about how to do it without becoming vulnerable to unfair-employment-practice suits. Want to eliminate a favorite federal program? Beware of the lawyers who inevitably will be brought in as consultants to protect the interests of the target group.

"This is a big, big law town," Grier said. "There's just a tremendous amount of legal work that goes on here."

What about hamburgers and hot dogs and other fast-food services? They don't count in this report, Grier said. The services study was based on the 1982 Census of Service Industries, which eschews fast-food shops and the like. "Fast-foods shops are classified as belonging to the retail industry," Grier said.

Services, for this purpose, include auto-repair shops, hairdressers, advertising, data processing, hotels, motels, social services, and telephone answering. There are some performance surprises in the lineup.

For example, Washington is a big tourist town that seems to have a hotel in every other block. Hotels and motels are scattered all over the adjacent suburbs. But the hotel industry accounted for only 4 percent of the area's 1982 service dollars. Auto repair constituted 3 percent.

Within the area, the District of Columbia had the largest share of the service pie -- 33 percent, about $4.2 billion annually. Montgomery County came in second with 24 percent, $3 billion; Fairfax County, third with 17 percent, $2.2 billion; Prince George's County, fourth with 10 percent, $1.3 billion; and Arlington, fifth with 8 percent, $1 billion.