Home prices in the Washington area have shot up this year and sales have slowed, but that hasn't put a big dent in the region's real estate market, according to industry experts. Most of the buyers pushed out of the market were first-time purchasers, a shrinking segment of the Washington housing market.

The cost of existing homes in this area rose 17.1 percent during the April-June period, compared with the first three months of 1987, escalating from a median sales price of $107,700 during the first quarter to a median price of $120,400 last quarter, according to a National Association of Realtors survey.

Only 10 other metropolitan areas throughout the United States, including New York, Boston and Los Angeles, recorded bigger median sales price increases in the second quarter, the NAR report said. The median price, the point at which half of the houses cost more and half cost less, more accurately reflects the market than the average price, experts say.

Price increases for existing homes here and elsewhere in the nation were triggered by heavy demand for housing and followed an earlier acceleration of new-home prices, according to John A. Tuccillo, the NAR's chief economist.

Across the nation, the cost of new homes dropped slightly in July: The median price of newly built houses went down by $1,000 to $107,000 from the previous month, the Commerce Department reported last week. The $107,000 median price, however, was a sharp increase from July 1986, when the figure was $94,100.

With its largely white-collar work force of government and corporate employes, the Washington area real estate market "can stay active despite the high prices" and rising interest rates, Tuccillo said. He predicted that the Federal Reserve Board's increase in the discount rate last week will result in fewer sales nationally, a "slight" drop in prices and fewer housing starts. "Washington will follow this pattern," he said, but more moderately than the rest of the nation.

Price increases turned out to be a break for Jerry and Nancy Megas, who had been trying for months to sell their Arlington home so they could buy a larger house. A sharp upturn in interest rates last spring put them in a squeeze, cutting down on the number of prospective buyers who could afford their house, located in a neighborhood where homes sell for $250,000 and up.

At the same time, the couple could "afford less of a move-up house than we originally expected," Jerry Megas said. By the end of the summer, "people came back from vacation and the market finally caught up with our price," he said. "Our house became a better deal." The couple sold their house and signed a contract for a new house that will be completed in about six months.

Several market experts called Washington one of the hottest single-family home markets in the country despite price increases and slower sales. During the first six months this year, developers here took out 15,090 permits to construct single-family homes, a drop of 1,900 permits from the same period in 1986, but enough to make Washington the second busiest market in the nation, behind Atlanta, according to the National Association of Home Builders.

Move-up buyers dominate the Washington market, as a growing number of young families and individuals are squeezed out of the market. Many second- and third-time buyers want bigger houses with more luxuries and often want smaller yards to care for, according to builders and other real estate professionals.

In addition to rising costs, the heavy pace of sales in 1986 and early 1987, when interest rates were lower, was a factor in declining sales here in recent months, industry officials said. By now, the number of houses available has been reduced and there are fewer buyers out shopping, they said.

Second-quarter existing home sales in the District of Columbia declined by 22.1 percent from the same period a year earlier, according to the NAR. During the same period, Maryland sales dropped 7.8 percent and, in Virginia, sales were down by 18.6 percent. The second quarter of 1986, however, was the peak period of sales last year, the NAR's Tuccillo said.

The slower pace of sales eventually will push down prices, but that has yet to happen in Washington, according to Kent W. Colton, the NAHB's executive vice president. Local builders will complete homes already under construction and those already planned, "but they're being careful about the future," Colton said. In many other parts of the country, however, home builders are cutting back on their production, he said.

A nationwide survey of about 3,000 home buyers, conducted by the NAHB, reflects many characteristics of Washington area purchasers. Between 1984 and the first quarter of 1987, first-time buyers dropped from 40.3 percent of all purchasers to 35.9 percent, the study showed. A significantly larger number of buyers wanted bigger homes -- four or more bedrooms, 2 1/2 to 3 bathrooms, at least one fireplace and from one to three skylights.

The changing demographics have encouraged a number of developers to build for the more affluent purchasers.

Maryland builder Robert I. Mitchell is one such builder. His company is building for move-up buyers and "empty nesters," couples whose children have left home, a market in which sales have slowed to some extent but not enough to cause serious concern, he said. Mitchell is positioning his company to be ready for the increasing number of older home buyers as the baby boom generation "moves like a wave" through the next decade.

Builder Ray Smith said his business has picked up after a summer lull and that there is "a real demand" for the mid-price-range town houses and condominiums he builds in Fairfax, Prince William and Loudoun counties. Most of his customers are second-time buyers. With interest rates going up, he said that "it may be that people can't afford quite as big a house as before, and that may be why my town houses are selling well."

Until recently, most town houses were built as "starter homes" for young, first-time buyers. Now, many town houses are more luxurious and priced for higher-income buyers, whose choice is "almost a life style decision," said Pam McCoach, president of the Northern Virginia Board of Realtors. "Many buyers are two-career families who don't want to spend time with yard work. They have hobbies, more extracurricular activities."

Developers in Fairfax and Montgomery counties said the growing scarcity of land has driven up costs, with the escalation in land prices in the last 12 months "staggering," according to Martin Poretsky of the Poretsky Building Group.

In one area of Silver Spring, "our per-lot cost is what we sold houses for in the early 1970s," Poretsky said.

Even with higher costs, though, "there is still a favorable market" in suburban Maryland, said James W. Hubbard, executive vice president of the Suburban Maryland Building Industry Association. Building permits issued in the first six months of 1987 have risen 6 percent over the same period last year, he said. Business is particularly brisk in Prince George's, where builders took out 2,685 permits, 464 more than in the first half of last year, Hubbard said.

Prices of homes throughout the United States have risen an average of 8.4 percent yearly since 1970, according to Salomon Brothers Inc., a Wall Street investment house. During the first half of 1987, prices rose by 8.3 percent over last year's median price, more than any annual increase in the past six years. These figures include new and existing homes.

Across the country, the slowdown in sales reflects interest rate increases, which hurt sales of less expensive houses the most. More affluent buyers are still in the market, however. "This has had the perverse impact of making the house price figures jump at a time when the housing market is declining, mainly because the mix of homes has shifted to the more expensive units," the Salomon report said.