Soured loans for office buildings and other commercial real estate cut pretax profits at Perpetual Savings Bank, the largest savings and loan in the Washington area, by $23.9 million during the past three months, the Alexandria-based company announced yesterday.

Most of the losses stemmed from problem real estate in Maryland and Virginia, with the rest scattered throughout the mid-Atlantic region, Perpetual spokesman Jim Pastore said. Despite the losses, Perpetual's overall profits for the period increased.

Perpetual's announcement is a sign that the demand for office space and other commercial property is softening in the suburbs of the District and, to a lesser degree, in downtown Washington, developers and real estate investors said yesterday.

"There is more space being added than there is being absorbed," said Stephen Goldstein, senior vice president at Julien J. Studley Inc., a property management firm. "There will be a slowdown of new starts on commercial office buildings. I think the slowdown applies more in the suburbs than in the District but it's a trend nonetheless."

Perpetual Chairman and Chief Executive Thomas J. Owen said, "There is a slowing but I wouldn't compare it to anything in the Southwest. This is still the best market in the United States."

Perpetual said it wrote off $19.4 million in real estate loans and repossessed property for the three months ended Jan. 31 and added $4.5 million to a reserve against future losses on loans. "The market didn't support the properties the way we thought it would," said Pastore.

Despite the writeoffs and the increased buffer against future losses, Perpetual's revenue from the sale of a downtown office building boosted profits for the period -- the first quarter of fiscal 1988 -- to $16.6 million ($1.14 a share), a three-fold increase from the $5.3 million (31 cents) the company earned in the same period a year ago.

Since 1982, Perpetual, like the rest of the savings and loan industry, has shifted more of its assets from its traditional business of making home loans into the risker field of commercial real estate loans. Today 42.5 percent of the company's loans are in commercial real estate.

Perpetual's losses on commercial real estate loans illustrate the problems that can occur as a result of that shift -- even in a relatively strong market such as the mid-Atlantic area, where property values are much healthier than in economically depressed regions such as the Southwest.

In recent months banking regulators have expressed fears that the real estate slump in Texas and other oil-patch states might spread to the Northeast, where banks and S&Ls have experienced a troubling rise in problem loans.

The commercial vacancy rate in Washington's suburbs is 15 percent and is expected to rise to 17 percent this year, according to the Real Estate Research Corp. of Chicago. That's about 8 percentage points less than the national average for suburban commercial properties, but slightly higher than normal for this area.

The D.C. Realtors Association estimates a 10.5 percent vacancy rate in the District. The major cities of Texas have the highest commercial vacancy rates in the nation; the rate in downtown and suburban Dallas is 32 percent.

In the Southwest, real estate prices have been in a slump since the early 1980s, when oil prices fell and pushed the economy of Texas and surrounding states into a recession. In recent years, a record number of bank and savings and loan failures in the Southwest have focused attention on the region.