Deputy Police Chief Robert W. Klotz, the square-faced street commander familiar to thousands of demonstrators here, retires this month, taking with him his unorthodox leadership style of firmness, flexibility and whimsy.

Longtime commander of the D.C. police department's special operations division and its crack Civil Disturbance Unit, Klotz, 46, is most often seen walking at the head of the ragged tribes of political protesters who come to Washington, shepherding the marchers along with his retinue of scooter-mounted patrolmen and keeping a wary eye out for disrupters.

"I always like to be at the front of a march line," he said recently. "A march line is kind of like a caterpillar. If you've got a good hold on the head, the rest of it will follow."

Born and raised in Washington, Klotz is a street tactician with an intimate knowledge of every nook and most crannies in the city. He has walked its length and breadth at one time or another with groups ranging from religious fundamentalists, angry farmers and Vietnam war protestors to assorted Iranians, Afghans and Ethiopians.

It was Klotz who masterminded the barricading of the farmers' tractors on the Mall two winters ago, and it was his men who repeatedly stopped militant Iranians from attacking the former shah's embassy on Massachusetts Avenue NW by blocking them at the bridge over Rock Creek.

"I love that bridge," he once said in his flat D.C. accent. "I'd defend that sumbitch all day long."

Once, after he had escorted a band of flinty-eyed Revolutionary Communist Party members through the Shaw ghetto to a rally inside the Howard Theatre at 7th and T streets NW, he turned to a reporter and said in a low, conspirational tone, "Now, my next move is to lock the doors and make 'em watch continuous back-to-back John Wayne movies."

Easily recognized by his crew haircut and pleasantly builldoggish face, Klotz is both flexible and firm with demonstrators. If they deviate from a prescribed march route, for example, he might allow it, but if things start to get out of hand he will warn the leaders to get their troops back in line or face unspecified consequences.

"I never get into a situation without knowing who's going to win," he said. He makes a point of never disclosing how many officers he is holding in reserve in the event of trouble and has prided himself on the discipline and close supervision of his men during violent confrontations.

He publicly defended his officers against allegations of brutality in Iranian demonstrations here July 27, but is known to be privately disappointed that some officers were excessively rough, tarnishing the image of the special operations division.