Last September, developer Meridian Group watched as vacancies swelled to a quarter of the 365,000 square feet of space in its 3 Bethesda Metro Center, a 15-story office building atop the Bethesda Metro station.

"We had a few tenants go bankrupt on us, and a few didn't renew," said Bruce S. Lane, executive vice president at Bethesda-based Meridian.

But now leasing has picked up, cutting the vacant space by nearly half.

"We've seen a whole lot of new tenants being optimistic about expanding," Lane said. "Last year people were more pessimistic."

Office vacancies in suburban Maryland fell to 11.8 percent in the second quarter from 12.6 percent in the second quarter of 2003. That is close to the average for the region, which as 11.6 percent, said the real estate research firm CoStar Group Inc. of Bethesda.

But the strength of its office market is at the same time suburban Maryland's weakness. While it didn't suffer as much as Northern Virginia during the economic downturn of the last few years, Maryland's stability means it has less upside than the much bigger Virginia market across the Potomac. Northern Virginia's vacancy rate is usually lower than suburban Maryland's.

Even though it was 14 percent in the second quarter -- more than 2 percentage points higher than suburban Maryland's -- Virginia's vacancy rate is dropping just as fast. And Virginia's office market seems more likely to boom in the next year, brokers and developers said.

"Maryland is holding its own, but it looks like Northern Virginia is starting to see more activity," said David A. DiNardo, a senior vice president at Grubb & Ellis Co. "In Maryland, we've got some submarkets that are picking up, like in Greenbelt and Lanham. But then along the Interstate 270 corridor in Montgomery there's not as much happening as people would like."

Suburban Maryland's mix of businesses -- civilian government institutions such as the National Institutes of Health and the generally smaller contractors that serve them -- make a relatively more steady economy and a stable office market.

In Northern Virginia the tech crash that began in 2001 wreaked havoc on information technology companies, and the telecom bust put thousands of people out of work at phone companies such as WorldCom Inc., sucking tenants from buildings all over the area.

But with the boom in defense spending after the Sept. 11, 2001, terrorist attacks, many Northern Virginia defense contractors, which did less well after the Cold War, are prospering again. Some, such as General Dynamics Corp., are among the biggest defense contractors in the world.

There are some bright spots in Maryland, too, just not as many. In Howard and Anne Arundel counties, contractors for the government's National Security Agency have taken lots of space.

"Howard's story this year is that it's a comeback kid," said Peter S. Briskman, vice president at Staubach Co., a commercial real estate firm. "The vacancy rate has gone down by 25 percent since last year."

Prince George's County has benefited from out-of-town investors wanting to buy cheaper buildings as places like Bethesda in neighboring Montgomery County get more crowded and expensive, said John M. Germano, senior managing director for the Washington and Baltimore region for CB Richard Ellis Inc.

"Prince George's has a great location to D.C.," Germano said. "It's been sleepy lately and it hasn't had a stellar reputation, but savvy real estate investors who are looking for where things are headed are looking there with interest."

Germano said he represents national investors such as Teachers Insurance and Annuity Association of America and the Ohio State Teachers Retirement System, which are looking for buildings to buy in Prince George's.

In Montgomery County, some areas lag while others are doing well, such as Silver Spring, to which the American Nurses Association moved from Capitol Hill. Union Labor Life Insurance Co. will move some employees from Massachusetts Avenue to an 85,000-square-foot spot in Silver Spring, said Lawrence E. Thau, managing director at CB Richard Ellis in Bethesda.

Space that media giant Discovery Communications Inc., which moved into a new headquarters in Silver Spring, left behind in Bethesda has been taken by mortgage company Fannie Mae. Some of the 154,000 square feet that Pacific Gas & Electric Co. left in a building on Old Georgetown Road in Bethesda has been leased to the research company LexisNexis, Thau said.

One market that's hurting, brokers said, is Germantown along the Interstate 270 corridor. An 18 percent vacancy rate is fueled by companies like Acterna Corp., a telecommunications company, which is consolidating and putting space back on the market.

The glut is forcing landlords to pay more for improvements before choosy tenants move in, Thau said. "Free rent is back in some cases," too. Thau said. "And there's room to negotiate in the asking rental rate."

Things are tough for landlords in Virginia, too. But many people expect the market to roar back within a few years as it works off its empty buildings.

The number of jobs is increasing all over the region, but disproportionately in Northern Virginia, said economist Stephen S. Fuller at Virginia's George Mason University. The Labor Department reported recently that the region added 82,000 jobs in the year ended in June, compared with the average 44,000 new jobs added in each of the nine other largest U.S. metropolitan areas, Fuller said. About half the new local jobs require office space; the rest are retail or construction jobs.

About 70 percent of those new jobs are in Northern Virginia, compared with 22 percent in suburban Maryland and 8 percent in the District. The disparity between the two suburban areas shows a big shift from the 1990s.

Back then, Fuller said, Northern Virginia created 2.15 jobs for every one in suburban Maryland; now that ratio has widened to 3 to 1.

When growth in federal government spending took off in the last few years, Fuller said, Maryland didn't have the office space to accommodate it. Higher vacancy rates in Herndon, Reston and Tysons Corner attracted companies to Northern Virginia that might have gone to Maryland had space been available.

Overbuilding in Northern Virginia in the late 1990s and into the new century, which resulted in three dozen vacant buildings at one point, is benefiting the area now, Fuller said.

"And Maryland space is not as competitive," he said. Its office buildings tend to be smaller and more spread out, he said.

Of the 40 largest lease deals in the region this year, only three were in suburban Maryland, including No. 35 and No. 39, CoStar said.

On the other hand, suburban Maryland's vacancy rates are generally improving. The rate in Montgomery County, with the third-largest office inventory in the region after the District and Fairfax County, fell slightly to 11.8 percent in the second quarter, from 12 percent a year earlier.

And despite the attractions of Northern Virginia, several developers said they are working on major suburban Maryland office projects or planning them.

JBG Cos., one of the region's largest office developers, said nine of its 32 projects in the Washington area are in suburban Maryland, including the 228,000-square-foot Market Square building in North Rockville that it is nearing completion and is fully leased to the Department of Health and Human Services. JBG said the lease was the largest signed in Maryland last year. JBG is also proposing a large-scale office, housing and retail complex near the Rockville Metro site, for which it is seeking approval from the Rockville city government.

Lane, the Meridian Group developer, said he and partner G. David Cheek are spending $16 million to renovate 3 Bethesda Metro Center and the adjacent 390-room Hyatt Regency Bethesda hotel the company owns.

"We're starting to see some recovery," said Roberta Levy Liss, a senior vice president for Trammell Crow Co., another large developer and leasing company. "We didn't see a lot of activity in Montgomery County in 2003. Bethesda-Chevy Chase is improving. We've had three consecutive quarters of positive absorption."

Still, Maryland isn't likely to overtake Virginia anytime soon. "Demand in Maryland is likely to build more slowly," said Sandy Paul, director of research for the mid-Atlantic region for Delta Associates, an Alexandria real estate research firm. "Investors see a little more opportunity in Virginia."

Even with a higher vacancy rate, Northern Virginia landlords charged on average $1.50 more a square foot for rent -- $25 -- than those in suburban Maryland during the second quarter.

And developers were putting up 6 million square feet of space in Northern Virginia in the quarter, three times what they were building in suburban Maryland.

Tenants are gobbling up space in Virginia, CoStar said. In the second quarter, tenants filled a net 2.2 million square feet of space in Northern Virginia. The net was 260,000 square feet in the District and less than 200,000 in suburban Maryland.

Delta Associates predicted a continuing decline in the vacancy rate in both places in the next two years, and that Maryland will continue to have a lower vacancy rate -- 9.5 percent -- than Northern Virginia with 11 percent, largely because of all the construction in Northern Virginia. The District's rate may rise slightly to 9 percent because of only moderate pre-leasing of new buildings by developers and only moderate job growth, Delta said.

That means the net space leased each year is now on track to match the long-term annual average of 8.1 million square feet, the research company said. That is substantially better than any of the past three years, when the average was less than half that.

"The speed at which the market is recovering is surprising," Paul said. "It's pretty impressive."

Staff writer Dana Hedgpeth contributed to this report.