The population of Washington edged downward last year after three years of apparent stability while growth accelerated in Virginia and Maryland, according to U.S. Census Bureau estimates.

The city's population was 622,000 in mid-1987, down 3,000 from the revised estimate for a year earlier, the Census Bureau said. In 1986, the bureau reported that the number of D.C. residents rose by 2,000, the first rise in 23 years.

"I think it's losing slightly again," said Edwin Byerly, the Census Bureau statistician in charge of preparing the new figures. "That's no big story."

During the 1970s, the District's population decline was far steeper, averaging almost 12,000 a year, as large numbers of black families moved to the suburbs. The population in 1980 was 638,333.

The new figures contain no estimates by race, but 1986 estimates, issued last fall by the Greater Washington Research Center, indicated that the black exodus had slowed while the city's white population -- about 27 percent of the total in the 1980 census -- rose slightly after falling dramatically for more than three decades.

According to the new report, Virginia's population grew by 109,000 to 5,904,000 from mid-1986 to mid-1987 while Maryland's population rose by 74,000 to 4,535,000. In both states the one-year increase was the largest in more than a decade and reflected healthy economic growth, demographers in both states suggested.

"Certainly, the state has fared well in recent years," said Michael A. Lettre, assistant secretary of the Maryland Department of State Planning. "Things are prosperous, and we've reversed the net outmigration that occurred in the late 1970s and early 1980s."

Maryland's population growth has been about one-third faster during the 1980s than it was during the slow-growth 1970s, though it is still below the very rapid growth of the 1950s and 1960s. The state now is growing faster than the United States as a whole after lagging for more than a decade.

With last year's increase, Virginia's rate of population growth since 1980 is about the same as it was during the 1970s, and only slightly below that of the 1960s.

Virginia has been one of the nation's most steadily growing states, exceeding the national average for almost three decades.

The new census estimates are based on several complex formulas, using birth and death statistics, school enrollment and housing unit reports, and data from income tax returns and Medicare and immigration records.

The population of the United States reached 243.4 million in mid-1987, a gain of 2.3 million in a year and 16.9 million, or 7.4 percent, since 1980.

Florida passed Pennsylvania to become the nation's fourth most populous state, behind California, New York, and Texas.

The population estimates for the District were issued by the Census Bureau along with those of the states, but no 1987 estimates have been reported yet for individual counties and cities.

Based on 1986 estimates, state officials believe Montgomery County was the largest center of growth in Maryland, while growth in Virginia was concentrated in a crescent from booming Fairfax County to the Richmond area and Tidewater.

Several demographers suggested that the renewed slight loss in the District's population is probably comprised mostly of middle-income black families with children. Construction of town houses and other moderately priced units has increased in many suburbs, encouraging such families to move.