A retired Navy warrant officer who had access to classified information was arrested by federal agents yesterday in a Rockville motel and charged with espionage, according to FBI Director William H. Webster.

Retired Chief Warrant Officer John Anthony Walker Jr., 47, who was born in the District, but who has been living in Norfolk, was being held last night without bond pending a preliminary hearing in federal court on May 29.

Federal Magistrate Daniel E. Klein Jr. presided at a hearing in Baltimore yesterday, where Walker was charged with espionage.

The FBI said that Walker was arrested after FBI agents saw him on Sunday night leaving a large bag containing 129 classified Navy documents at an alleged drop site near Poolesville, a small community in the western part of Montgomery County. The drop was made on Sunday night on Partnership Road, about 300 yards south of Whites Ferry Road, the FBI said.

The documents recovered by the FBI had been carefully wrapped in plastic and concealed in a shopping bag partly filled with trash, a spokesman for the agency said. The documents contained Navy classified information about the deployment of Soviet vessels in the Mediterranean and movements of Soviet merchant vessels, according to the FBI, and some of those documents were believed to have come from the U.S. Navy nuclear aircraft carrier Nimitz, on which Walker's son, Michael L. Walker, is serving.

Assistant U.S. Attorney Michael Schatzow, who attended yesterday's hearing in Baltimore, said that one of the FBI investigators testified that the agency learned through other sources that Walker had been providing information to the Soviets for as long as 15 to 18 years.

An FBI spokesman in Washington said it appeared Walker earlier had successfully delivered information to the Soviets. "We had to rush this because of what we saw happening at the drop site," he said. "Of course, we will turn close scrutiny now on all of Walker's relatives and contacts."

According to the FBI, one of the documents confiscated appeared to be a letter, which stated: "This delivery consists of material from 's' and is similar to the previously supplied material. The quantity is limited, unfortunately, due to his operating schedule and the increased security prior to deployment. His ship departed in early March and they operated extensively just prior to deployment."

The Nimitz deployed in "about mid-March," according to the Office of Navy Information.

Two agents arrested Walker at about 3:30 a.m. Monday in the hallway of the Ramada Inn near Darnestown Road and I-270 in Rockville, according to federal officials. They said that Walker pulled a revolver on the agents but then surrendered without a struggle.

The federal complaint filed against Walker charges him with espionage and alleges that he obtained national defense information for passage to the Soviet Union with the intent or reason to believe that it was to be used to injure the United States or give advantage to a foreign nation.

If convicted, Walker could face life imprisonment.

Walker's arrest capped a surveillance effort by the FBI that began at his Norfolk home, and wound around the Washington area into the Montgomery County communities of Poolesville and Rockville.

According to the FBI affidavit, agents had Walker under surveillance from the time he left his home in Norfolk, apparently on Sunday, and followed him as he drove to Montgomery County. The affidavit said that Walker drove in a circuitous manner as though to avoid being followed or to determine whether he was being followed.

At about 8:37 p.m. Sunday, agents saw Walker stop the van he was driving along Partnership Road and get out and deposit the shopping bag at a tree marked with a "No Hunting" sign, the affidavit said. Walker then left the area in his van, and agents confiscated the bag, according to the filing.

It also said that a Soviet assigned to the Soviet Embassy in Washington was seen at the drop area after Walker left, but not detained.

Walker was born in Washington on July 28, 1937, and served in the Navy as a communications specialist until he retired in 1976. He reportedly owns an airplane and a van, and operates two companies from a Virginia Beach office about 15 to 18 miles from his home in Ocean View, a community on Chesapeake Bay.

One company is a detective agency called Confidential Reports Inc. The other is a debugging company, named Electronic Counter-Spy Inc.