Four years ago in an office in the Rockville courthouse, a clash between Montgomery County's fiery chief prosecutor and hot-tempered police chief erupted into a shouting match over trying prostitutes enticed from D.C. massage parlors by undercover county police.

Sarcastically referred to by both State's Attorney Andrew L. Sonner and Police Chief Bernard D. Crooke Jr. as "April Fool's Day," that argument and others over what crimes should be pursued have escalated through the years into a cold war between the county's top two law enforcement officials that has kept the men from meeting on business.

But in the past seven months the clash of egos and law enforcement priorities has been eclipsed by a more serious confrontation. In October, Sonner's office began presenting evidence to a county grand jury impaneled to consider whether top county police officers, including Crooke, allowed high-stakes gambling to occur at the Progress Club in Rockville.

Friends and associates of Crooke and Sonner said the deep rift comes of incompatible personalities and is widened by contrasting approaches to law enforcement, particularly the role played by police intelligence, including undercover work and scientific analysis of patterns in crime.

"Whether Bernie and Andy like each other is irrelevant -- what matters is that the public is well served by both offices," said Russell E. Hamill, Montgomery's assistant chief administrative officer, who echoed the sentiment expressed in interviews with police officers, prosecutors, defense attorneys and county and court officials that law enforcement needs are being met in Montgomery.

"Eisenhower and Patton didn't like each other and they won a war. Kennedy and Johnson didn't like each other and they got the job done," Hamill said.

But County Executive Charles W. Gilchrist, while underscoring his respect for both men, said their divisiveness has led to occasional "tension" in county offices. "Since they're both people we work with, it gets uncomfortable at times," Gilchrist said in a recent interview.

"We've had this Progress Club situation which has been a matter of dispute between the two of them, and frankly, we've got more important things to worry about . . . ," Gilchrist added.

The grand jury investigation underscores differing law enforcement philosophies espoused by Sonner, who favors intelligence gathering as the key to breaking crime rings by catching their leaders, and Crooke, who places a priority on traditional police methods of arresting and locking up street criminals.

"They the police department should have a unit . . . analyzing whether criminal activity is organized and how can we shut it down," said Sonner. "For instance, if burglars are operating through a fence, we can catch all the burglars and the fence will keep replacing them. Intelligence is a means to prevent crime and to make arrests and investigations more effective."

But Crooke countered, "If someone's breaking into your house at 3 a.m., it doesn't matter if you have intelligence out the wazoo, if you know every organized crime figure in the world. What matters is can you get a patrol officer over to that house."

In recent and occasionally emotional interviews, Crooke has defended his 800-member department and the reputation for honesty that he has built during 29 years as a police officer -- a reputation that followed him from the District, where he served for 23 years, to Montgomery when Gilchrist appointed him to the $71,229-a-year position as police chief in May 1979.

"When I get accused of being a liar or a thief -- that really lights my fuse. I've got to speak up," Crooke said in a recent interview in his pin-neat Gaithersburg office, decorated with plaques, photographs and tongue-in-cheek color posters of pigs.

Crooke said he is confident that the grand jury will clear his name and those of his men but that the lengthy grand jury investigation has been professionally and personally painful.

"Of course I've got a lot of anger in me. Personally, I'd like to see him Sonner out of office. Personally, I think he runs an excellent shop and hires great people, I just don't like his method of operation," Crooke said. "After the events of the last year -- the innuendoes made against the police department in connection with the Progress Club -- I'll never be an admirer of the man."

Sonner defends his actions, saying subpoenaed county police intelligence files on the Progress Club, which had been under investigation by Montgomery police since it moved to the county in 1979, raised troubling questions that the grand jury needs to answer.

"The Progress Club believed itself immune from arrest and prosecution. Not to investigate under those circumstances would have sent the wrong message to the police and to the community. To suggest that this in any way is connected to those former disagreements with Crooke is ludicrous," Sonner, who will stand for reelection to his $66,532-a-year post next year, said.

The grand jury probe has focused on three areas:

* Contributions totaling $5,500 for police-affiliated charities solicited in 1983 -- at Crooke's direction -- by Montgomery County police from the exclusive, all-male club.

* Why county police abruptly stopped a years-long undercover investigation of gambling activities at the club in March 1981. Rockville city police raided the club last June, and Sonner's office brought charges of illegal gambling against it.

* Whether county police officers assured club members that they were shielded from arrest and prosecution for gambling.

The Progress Club went on trial last year on the gambling charges, but the high-profile, four-day trial ended in a hung jury in December. The club, in a plea-bargain arrangement, later agreed, among other things, to shift its focus from card-playing to other activities.

In news conferences following the raid, Sonner likened the club to a gambling casino and hinted at some club members' possible links to organized crime.

"What better way to justify the Progress Club," Crooke responded. "They weren't organized crime, the biggest gambling ring in the state -- so did he Sonner turn the issue into a crooked police chief, crooked police officers, a crooked investigation or what?"

Sonner dismissed Crooke's allegation with salty language and a raised voice. "To think that somehow because Bernie Crooke crossed me, I'm after him now -- that is total expletive deleted . . . ," Sonner said. "He's miffed and sulking and he's embarrassed that he solicited that money and he should be. It's his problem and not mine -- he doesn't have me under investigation."

Shortly after his appointment, Crooke reorganized the police department's intelligence and vice unit, folding it into the Special Investigations Division along with narcotics and pharmaceutical crimes. He said he did so because he thought the intelligence squad was ineffective, failing to bring cases -- including the Progress Club -- to arrests and successful prosecution.

After the reorganization, Sonner and Crooke clashed over the police department's use of undercover officers to solicit sexual offers from homosexuals in Silver Spring in 1981. Sonner dropped charges against two men arrested in the undercover operation, warning the police not to pursue such "victimless crimes."

Sonner also won the "April Fool's" argument -- telling Crooke not to use the county's law enforcement muscle on petty sex crimes between consenting adults because such cases would not be prosecuted. But, he said recently, a lingering consequence of winning that round was a permanent weakening of the police department's intelligence operation.

"There's an area of turf here, and I'm not trying to say, 'Bernie, you're in trouble here because you don't have an intelligence unit.' I think it's very important to have an intelligence unit, but that's Crooke's decision. I don't think law enforcement manpower should be spent on victimless crimes," Sonner said.

Crooke maintains that the intelligence unit was reorganized rather than diminished. "It works better now; it gives us what we need," he said.

Then, in the most widely publicized disagreement, during the 1981 county fair, police and FBI agents confiscated 53 games, charging they were rigged, illegal gambling devices.

Under Sonner's direction, prosecutors arranged a plea agreement in which the game owners admitted ownership in return for release of the machines. Crooke refused to release the machines, calling them "instruments of crime," and he publicly denounced Sonner.

Since the April shouting match, the two men have not met to discuss law enforcement priorities. Sonner and Crooke say they have spoken on the telephone only a few times. They avoid each other at official county functions and take frequent swipes at each other privately, according to friends and colleagues of both, and at such public forums as panels and news conferences.

The public rancor is being closely followed by county officials, especially the effects of the current grand jury probe.

"The real question is what's going to happen when and if the grand jury investigation ends," said J. Theodore Wiseman, public defender for the county. "That's assuming nothing comes of it. The professionals are going to do their jobs regardless of whether their bosses are fighting. It could end and the two of them might feel like after a divorce -- they have to get even with each other. But if it doesn't get any worse that it is now, it's going to be okay as far as the county's concerned."

But Robert DiGrazia, who preceeded Crooke as police chief, offered a time-honored solution to the clash. "I wish I could grab each one of them by the ear and say, 'Okay, shake hands or you're going to the woodshed with me,' " DiGrazia said.