The United States publicly accused the Soviet Union yesterday of "crude intrusion" into the compound of the U.S. Embassy in Moscow and setting up a "secret listening post" equipped with electronic spy devices within the U.S. chancery building.

State Department spokesman John Trattner said the listening post was discovered in the chimney of the chancery building and was linked to an undergroud tunnel "extending considerable distance through the embassy property."

The underground tunnel was connected to a "neighboring Soviet apartment building" and Soviet personnel had been observed to enter and occupy the tunnel from the end connecting to the Soviet apartment building," Trattner said.

Trattner said U.S. security personnel discovered electrical cables to be "energized," adding, "There can be absolutely no doubt that this listening post had been actively operated by the Soviet side."

The U.S. charges were contained in a summary of an earlier American protest Tratner offered after dismissing as "absurd" Soviet public charges that U.S. Embassy personnel had pentrated into the neighboring Russian apartment building.

The Soviet charges were contained in a note Soviet Ambassador Anatolyi Dobrynin delivered to Secretary of State Cyrus Vance yesterday afternoon. The contents of the Soviet note had been released Thursday by the official Tass news agency.

The Soviets charged that the United States is using its Moscow embassy for espionage activities and that the embassy staff had penetrated that neighboring Soviet apartment building, destroyed its heating facility and damaged a "protective system" designed by the Soviets to counter U.S. intelligence operations.

U.S. officials said the Russians, in an earlier note, had claimed that the chimney shaft was not within the U.S. Embassy compound. "This," officials said, "was too far fetched to answer in writing" and the note was rejected as "totally erroneous."

Yesterday's charges suggested that U.S. security officials have known for some time about the existence of the underground tunnel. "We watched before we blew the whistle," one source said.

But it has yet to be determined how long the underground tunnel and the eavesdropping installation in the south wing of the embassy building have been in existence.

The embassy building was originally a Soviet apartment building constructed after the end of World War II. It was converted by Soviet Army engineers in 1951 and the U.S. embassy was established there in 1952.

State Department officials said the disclosure of details about the embassy bugging incident had been prompted by Tass charges Thursday about alleged U.S. espionage activites in Moscow.

Trattner said that it was expected here that the incident would not have any lasting effects on Soviet-American relations. "We don't intend that it will,", he added.