It was the ultimate nightmare for any company buying a piece of land.

After purchasing the property for $48,000, a lubricating-oil company started on plans to build a warehouse. But its bulldozers soon uncovered an awful surprise: the previous owner, a solvent-recycling company, had polluted the soil with toxins. The estimated cleanup bill was as high as $2 million.

When buying or renting commercial property, what you see isn't necessarily what you get. The Environmental Protection Agency has identified 22,600 potential hazardous-waste sites, and more are discovered every month. Under the federal law that established Superfund, liability for hazardous-waste cleanup follows land ownership. So even if waste was dumped 20 years ago, companies buying land today are liable. Companies that are leasing commercial space aren't responsible for paying to clean up earlier contaminations.

Pollution experts are urging companies to do their homework before buying land. It's wise to inspect the property for smudges in the earth and old cans or barrels, says John Varnum, a partner with the Washington, D.C.-based law firm of Stoel, Rives, Boley, Fraser & Wyse. Then, conduct a hazardous-waste audit by checking tax records to identify previous tenants, especially if the property is a vacant lot. Historical aerial photos, if available, will show what was on the site. And check with environmental officials to see if the seller has complied with regulations concerning toxic waste disposal. "Depending on the size of the company, the audit can be conducted by a consultant or even your own employees," says Varnum.

Before signing any papers, more companies are testing soil for evidence of toxic waste. "To ensure accuracy when testing soil, don't just assume any soil tester is as accurate as an experienced environmental engineer," says attorney David Lauretti, a principal with Updike, Kelly & Spellacy, in Hartford.

Some purchasers, says Varnum, get indemnification clauses from previous owners to protect them from liability if toxic waste is discovered on the property later. However, warns Varnum, "an indemnification clause is only as strong as the financial backing of the property seller."