There was a time when enough money flowed out of the Department of Transportation building to remove up to 18,000 billboards a year.

In the years after the Highway Beautification Act was adopted in 1965, the DOT directed the states to start removing billboards within 660 feet of major federal roads in non-commercial areas.

The law required that billboard owners be compensated for the signs that were removed, and a fourth-floor office at DOT distributed millions of dollars a year to the states for that purpose.

But now that Congress has cut those funds to a mere $500,000, the office has been reorganized into thin air, the program's staff has dwindled from 13 to four, and few billboards are coming down any more. Instead, DOT officials are anxiously following the progress of a House committee amendment, largely written by the billboard industry, that would all but abolish the federal program.

"We can't take down those signs that were supposed to be taken down because there's no money," said Myron Laible, a 13-year DOT veteran who used to travel the country to brief state officials on sign removal. "The whole program is quite uncertain. We're just waiting to see what Congress is going to do."

Even in their daily duties, these DOT officials often must react to the shifting winds on Capitol Hill. In one case, a single billboard owner has managed to force the department to turn 180 degrees on the question of paying for his signs.

From 1965 to 1972, Harold Newman put up more than 200 billboards on North Dakota highways, even though state officials had warned him that the signs might be illegal. The officials had not yet drafted rules to comply with the highway beautification law, which would force them to compensate Newman if they took down his signs later on.

They finally agreed to give Newman a temporary permit for the signs, but only after he signed a waiver promising not to demand compensation if the billboards had to be removed.

When the state later tried to take down the billboards, however, Newman Outdoor Advertising went to court and demanded more than $5 million. After nine years of complicated legal appeals that reached the Supreme Court, a federal judge ruled that North Dakota could remove the signs without paying a dime.

But Newman, whose firm now owns more than 90 percent of the billboards in the state, refused to give up. "I was faced with a Hobson's choice -- either sign the waiver or go out of business," he said. "The state has been very vindictive about this."

Newman took his case to Sen. Mark Andrews (R-N.D.), chairman of the Senate Appropriations subcommittee on transportation. Andrews pressed the issue with Transportation Secretary Drew Lewis, who refused to give the state any federal money to pay Newman for the disputed billboards.

"In our view, the federal law cannot be read to require compensation for the signs involved," R.A. Barnhart, the federal highway administrator, wrote Andrews in March, 1981. He added that he might have to withhold federal highway funds from North Dakota, warning that "continued inaction . . . could lead to the imposition of sanctions."

This set off something of a flap in Bismarck, and by last fall Lewis was trying to quell the fuss.

"Over the past few months, we have had several conversations about a number of signs in North Dakota," Lewis wrote Andrews. "We are reviewing the problem in your state." And the threatened sanctions? "I have no intention of proceeding with any such action," Lewis said.

But the senator still wasn't satisfied, and last December he drafted an amendment to the fiscal 1982 transportation appropriations bill. The amendment was designed to help exactly one person: Harold Newman.

"Notwithstanding any other provision of law," the measure said, payments to a billboard owner whose signs are removed "shall not be affected by any waiver of compensation." Andrews offered the measure during a nighttime committee markup session, and eventually it was signed into law.

DOT understood its new marching orders. Lewis dashed off another letter to Andrews, assuring him that he was "fully aware of the new law."

A spokesman for Andrews acknowledged that Newman was a longtime political supporter. "Newman made his plight well known to the senator," he said. "The senator felt he was entitled to compensation."

An aide to the senator said it was conceivable that the amendment might help other billboard owners besides Newman, but added: "We don't know of any other individual who was in quite that spot."

Lewis now says he will have to cut off the highway funds if North Dakota fails to pay Newman for removing the signs.

Therein lies the catch: Myron Laible's office has no more federal money available to compensate billboard owners, and North Dakota officials can't take down Newman's signs unless they pay him. The result is that the signs are still there, and the state is scrambling to negotiate a settlement.

The outcome may be similar in several other states, which are waiting for DOT to cough up $3.6 million to pay their overdue claims for removing billboards. "We're caught between a rock and a hard place," Laible said.