The farmers had gone up to the Capitol for a rally, leaving their 500-and-some tractors behind on the Mall, when Deputy D.C. Police Chief Robert W. Klotz had a brainstorm.

With the farmers away, the square-jowled 44-year-old commander of the Police Department's special operations division thought to himself: Why not surround their tractors with a barricade of trucks, buses and other D.C. government vehicles and bottle 'em up for good? No more traffic disruptions like the massive tie-up caused by the tractors Monday morning.

It was now 1:30 in the afternoon. Klotz figured he had to act quickly.

He beckoned to Capt. Joe Mazur, one of his top operations officers, and with a stick sketched a rough diagram on the sand "to show the captain just what I wanted," Klotz recalled yesterday. Mazur got on the radio.

Within minutes, a motley array of tow trucks, police cruisers, sanitation trucks, buses and other vehicles began moving into place, bumper to bumper, surrounding the tractors on the Mall. When the farmers returned they found they had been penned in, trapped.

It was another dramatic stroke, another massive stunt that has earned Klotz the reputation among his fellow officers as a consummate police tactician.

"It sort of seemed like too good of an opportunity to resist," Klotz said of the Mall in an interview yesterday.

He insists the barricading was not a carefully planned trap laid hours or days in advance but a spontaneous necessity triggered by the unexpectedly disruptive actions of the farmers Monday morning.

"It sure wasn't the original plan," he said.

"As they continued to gather on the Mall, I realized we had to do something (to prevent the tractors from returning to the streets)," Klotz said. "The idea came to me that if I could lock 'em in physically, I could prevent disruption of rush hour and also force 'em to produce a leadership for us to negotiate with."

He and other officials then radioed for the vehicular barricade, using Metrobuses, sanitation trucks from the Department of Environmental Services and tow trucks from the Transportation Department in addition to various police vehicles.

Many of the DES trucks were already on standby alert in East Potomac Park. Klotz said he had arranged with DES director Herbert Tucker for the trucks Sunday night, but not with a barricade in mind. "We had the DES trucks out just in case the farmers started dumping grain or something in the street that would have to be cleaned up," Klotz said.

Klotz, a 23-year veteran of the police force, is no newcomer to massive demonstrations and disruptions. Commander of the special operations division and the riot-trained civil disturbance unit since August 1977, he has directed police handling of every major political demonstration in the city since that time.

Before that as an official in the civil disturbance unit, he was involved in the handling of many of the mass antiwar demonstrations here. He recalled yesterday that the use of buses or other vehicles as a barricade to contain large-scale disruptions is not a new concept to the D.C. police.

The White House was ringed with buses in April 1970 to ward off militant demonstrators protesting the U.S. incursion into Cambodia in the Vietnam War. Two years later, Klotz was among, several officials handpicked by then Police Chief Jerry Wilson to assist local authorities in containing antiwar protesters at the Republican National Convention in Miami Beach. There, too, police ringed the convention hall with buses to keep the demonstrators out.

His drill-sergeant appearance and slightly bulldoggish face conceals an easygoing and often whimsical character.

During demonstrations, he is commonly seen walking at the head of the demonstrators, talking easily with protest leaders, cracking irreverent jokes and showing a willingness to bend a rule here or change a parade route there to avoid minor confrontations.

Yesterday, a jostling crowd of farmers at the Mall had snapped the aerials and let the air out of the tires of a police cruiser driven by Inspector Bryant A. Hopkins. With a sheepish grin, Hopkins approached Klotz in the crowd and said, "Sir, I've been captured. I wish to report the loss of two aerials and the air let out of four tires."

Klotz replied with mock severity: "You will, of course, fill out the appropriate forms."