D.C. Superior Court Judge Iraline G. Barnes has granted a temporary injunction halting the District government's collection of about $38.5 million in new taxes from long distance companies, according to an attorney for one of the companies.

Bill Malone, who is representing US Sprint Communications Co. in a suit against the city, said Barnes made her ruling from the bench in a hearing on Tuesday, saying she would follow the oral ruling with a written order. No order had been filed late yesterday, and Barnes could not be reached for comment.

Barnes' order has the immediate effect of halting the city's collection of tax bills that were sent to long distance companies last month under a law enacted during the summer by the D.C. Council. City officials had been counting on the estimated $38.5 million in new revenue to reduce the city's projected budget shortfall, which is estimated to be as high as $192.5 million this year.

Council member John A. Wilson (D-Ward 2), chairman of the Finance Committee, said he had expected Barnes' ruling, but said it would be a "devastating blow" to the District budget.

"I always thought this tax would be ruled invalid," Wilson said. "I never had any confidence in it. I don't know how we're going to adjust, but the mayor needs to look at how we're spending the money we presently have."

District administration officials were unavailable for comment late yesterday.

US Sprint and two other long distance companies sued the city in October to block the imposition of the special tax, which they said would violate the companies' due process rights under the Constitution. The companies also argued that the local tax would affect interstate commerce and thus infringe upon rights reserved to the federal government.

Barnes' order did not decide those claims, although she said there was a likelihood that the telephone companies would prevail at trial, which she scheduled for Dec. 22, according to Malone.

The District mailed its first tax bills to long distance companies on Nov. 16, Malone said. He said the bill sent to US Sprint was for about $900,000.

The council passed the gross-receipts tax this summer as a part of a compromise with Mayor Marion Barry over Barry's proposed $17.9 million income tax increase. The final version of the measure, which dropped the income tax increase in favor of the gross receipts tax and other measures, contained a provision that would make the companies' tax liability retroactive to July 1, 1986.

The tax, which was to be levied on the gross receipts of long distance companies, would bring in an additional $20 million from its retroactive provision, Barry administration officials have said. In fiscal 1988, it was expected to generate about $18.5 million in revenue.