A federal judge in New York yesterday temporarily closed down a group of companies accused of running a nationwide business in illegal crude oil investments.

Judge Whitman Knapp issued a temporary restraining order halting the firms' operations and also ordered the companies to open their books to state and federal investigators.

This will enable officials to determine for the first time whether there is actually any oil to back up the oil contracts the companies were selling, said officials of the Commodity Futures Trading Commission.

Based on complaints from residents of 31 states CFTC investigators believe the companies collected more than $20 million for what were called "spot crude oil delivery contracts."

In a complaint filed Monday, the CFTC charged the investments were commodity futures contracts, which under federal law can be traded only on federal regulated commodity exchanges by registered sellers.

The complaint, described as the biggest ever involving illegal oil investments, was filed jointly by the CFTC and the New York attorney general's office. New York officials earlier tried unsuccessfully to close down the operation for violating state laws.

The companies also allegedly misled investors by promising they could make huge profits by buying contracts for delivery of crude oil six months or a year in the future.

The sellers failed to tell investors that most of the money charged as a down payment on the contract was actually a sales commission. Authorities said it was unlikely oil prices would increase enough to make a profit big enough to pay off the sales commission.

Thirty companies and 37 individuals were named in the CFTC complaint, the agency investigators said yesterday they believe all the companies were associated. The crude oil contracts allegedly originated with a Panamanian company called Commerical Petrolera International, S.A.

Two American companies then sold the illegal contracts to more than two dozen firms which sold them by telephone to investors across the nation.