Japan has withdrawn its formal objection to a worldwide ban on sperm whaling to avoid tough U.S. economic sanctions, according to Commerce Department and Japanese Embassy spokesmen.

But the two sides disagreed sharply over whether the Japanese government's action on Tuesday would halt Japanese sperm whaling in two years or was simply a temporary maneuver to allow Japan to continue whaling for two years without the imposition of U.S. sanctions.

The Commerce Department, in a press release, said, "In effect, the Japanese have agreed to give up sperm whaling after the 1985 season."

But a spokesman at the Japanese Embassy, who asked not to be quoted by name, countered: "We have never said we will give up sperm whaling after 1985. That is only the United States' favorite scenario."

Yesterday's exchange was typical of the confusion that has characterized the whaling dispute since it first reached a crisis stage last month, at the start of the new whaling season. The Japanese have considered the ban an intrusion on a key part of their economy and cultural heritage. The United States, which under U.S. law must impose sanctions against Japan for its failure to comply, has been anxious to avoid a showdown with its most important Asian trading partner.

The ban was approved in 1982 by the International Whaling Commission. But Japan lodged a formal protest, which serves to exempt it from the ban, under the commission's rules.

The commission has no police powers, but under a U.S. law, economic sanctions must be taken against any nation that "diminishes the effectiveness" of the commission.

Negotiations between the United States and Japan on a way to avoid the sanctions sparked a lawsuit from environmental and animal welfare groups. Those groups had asked a U.S. District Court judge to force the U.S. government to impose the sanctions. Yesterday they asked him for an immediate decision in the case.