A lack of affordable housing in Fairfax County has spawned a black market for studio apartments and county officials are now scrambling to shut down the illegal apartment business without undermining the supply of cheaper housing.

Responding to a jump in demand for studio apartments, county residents have started building illegal studio apartments in their homes, renting them to people who, struggling with the recession, have been shunning the more expensive one- and two-bedroom apartments that dominate the local rental market.

But builders either aren't building studios or haven't finished the units, creating a shortage that has left some families homeless and others living illegally in other people's homes.

"The demand is high but the inventory is low," said Maggie Parker, spokeswoman for county developer Comstock Partners. "When the markets came back, the gates began to open and the money was in apartments. Everyone grew on a two-bed, two-bath plan for 30 years."

Some homeowners in the county recognized the lack of cheaper apartments and capitalized on the unmet demand by building illegal apartments in their basements or elsewhere in their homes for profit. County officials have found entire families living in closets and crawl spaces that were converted into miniature apartments.

"We've encountered circumstances where there are three or more such 'apartments' carved out of a single family home, all of which is done without approval," said Donna Pesto, with the county's Department of Planning and Zoning.

Residents are not explicitly banned from having renters in their homes, but they are required to go through a permit process to ensure the spaces are safe and conditions are livable, a step many renting homeowners skip.

County officials have begun work on new rules for studio apartments that they say can be built by nonprofit groups and other organizations that serve low-income people. The new rules would require each studio to have its own kitchen and bathroom.

"We've got working-class people who don't have housing opportunities," said Supervisor John Cook, R-Braddock. "We need more units and we believe that there's a market for them."

The board is expected to take up the new rules in the spring.