When Prince George's County Executive Parris N. Glendening announced his selection of a new police chief last week, no one may have been more surprised than the nominee.

Maj. Michael J. Flaherty, the 18-year police veteran Glendening named, wasn't even aware until a day or two before the announcement that he was in the running for the job.

"I had been approached by a number of people months ago," said the major, whose most recent assignment was acting director of the problem-plagued county jail. "I said no at the time. . . . Until last week, I made no efforts to go campaign for the job."

Flaherty, who has a reputation as an effective trouble-shooter, had commanded police districts in Clinton in the southern end of the county; in Hyattsville, the most populous; and in Seat Pleasant, an area of high crime that has had its share of police-community tension. In all posts, he received high marks from his superiors and community groups. In 1980, he was placed in charge of the bureau of patrol, where he supervised six captains commanding 650 officers on the street.

In the competition Flaherty finally entered, another candidate had been widely regarded as the frontrunner: Lt. Col. Joseph D. Vasco, who had briefly been acting chief in 1979, had campaigned long and hard for the post.

Vasco, however, carried some heavy baggage. He had been a key figure on a so-called "death squad" of detectives in 1967 accused of directing informers to lure participants into a series of store robberies and burglaries at which waiting police shot and killed two suspects, wounded a third and arrested several others. Although Vasco was absolved of wrongdoing in a recent civil trial, the original disclosure of the allegations by The Washington Post in 1979 triggered an outcry, especially from civil rights groups.

Also, while a county investigation in 1979 cleared Vasco and others of wrongdoing, a Maryland state police investigation concluded "death squad" members had "instigated" at least three incidents in which suspects were killed or arrested.

More recently, Vasco had worked hard to build bridges, especially to black groups in the county. It was admittedly an effort to gain support in his quest for the position of chief, held since December 1979 by John E. McHale, a former FBI agent appointed by then-County Executive Lawrence Hogan.

No sooner had Glendening been elected to succeed Hogan than speculation began over McHale's replacement, with Vasco the leading contender. Vasco had supported Glendening for executive and was the favorite of the Fraternal Order of Police, the police bargaining agent. But the "death squad" trial was in progress in Baltimore federal court, with Vasco a principal defendant.

So long as the trial continued, no action was expected on the new police chief. When Vasco was cleared earlier this summer by the jury in Baltimore, his campaign for chief began in earnest. "I'm putting myself out before the public," he told Washington Post Staff Writer Michel McQueen, "in the event the chief of police job becomes available."

From the Hillcrest Heights Civic Association's awards ceremony to the Marlow Heights Recreation Center, Vasco stumped for the post. He contacted County Council members and prominent black leaders, including the Rev. Perry Smith, Sylvester Vaughns and Josie Bass, the current head of the Prince George's branch of the NAACP. They tended to be noncommittal.

One he did not approach was committed--against his appointment. "I would raise holy hell," said Cora Rice, a former NAACP official.

After Glendening returned from a recent Maryland Association of Counties convention in Ocean City, the pace of events accelerated. "Let's face it. It's becoming a press-driven process," said Tim Ayers, Glendening's spokesman.

The process, it turned out, included a review of all those within the police department holding the rank of major and above. By the beginning of last week, Glendening had a list of six candidates, among them Vasco, McHale and Flaherty.

"You start taking a look at his record, he gets to be a star," Ayers said of the surprise candidate for chief.

Ironically, it was McHale who put Flaherty into a position of prominence. When Glendening fired Arnett Gaston as corrections chief last March, he asked McHale who could temporarily do the job. "They asked for one of our best men; we sent [Flaherty] ," McHale recalled.

While surveying his list of candidates, Glendening also met with representatives of black groups. Glendening politely rejected their request for a national search. His current preference, he said, was to promote from within the department.

The group led by Cora Rice was unalterably opposed to Vasco. An NAACP statement, issued after the group met with Glendening, was less direct but conveyed a similar message:

"To be most effective, the chief must be free from any involvement, association or allegation in incidents in the past of police brutality or actions where the loss of life of black persons occurred," the organization said. "A chief, at the very top of the police department, with such historical baggage, would be unnecessarily handicapped."

In what was becoming a battle of press releases, FOP president Mahlon J. Curran issued a rebuttal asserting, "We do not believe the position of chief should be a political one. . . . No outsider could ever be acceptable."

Vasco, Curran said, "came up through the ranks and has demonstrated time and time again his devotion to the safety and well-being of all persons in Prince George's County."

Glendening said he reached his final decision at 11 p.m. Aug. 24 and informed Vasco the following morning at breakfast. "Of all those mentioned, he's the one I know the best and like the most," Glendening said of Vasco at the press conference announcing his selection of Flaherty. When pressed on his meaning, he quickly added "as a person."

Flaherty, meanwhile, said he wants a strong second-in-command so that the chief can concentrate on community and media relations. Vasco, he said, can fill the bill.

"I've had many disappointments," Vasco had said the night before Glendening's announcement, adding he could accept any outcome. But, both surprised and disappointed when the final word came, according to close friends, he left town for a week's vacation with his family and to ponder his future.

Bass, the NAACP president, expressed relief over the choice. "I have worked with Mike Flaherty in the past," she said. "I found him to be compassionate, very thorough and community-minded. . . . I think the county executive made a good choice. . . . I am very happy the county executive did not move forward with the nomination of Joe Vasco."

FOP president Curran, on the other hand, said he was "very angry" with Glendening for bypassing Vasco. But he called Flaherty "an excellent police officer . . . the second-best choice."

Several days later, Glendening and his staff were assessing his decision and feeling vindicated. "There's no marching in the streets. We've not been barraged with letters or protests," Ayers said. "At least some cops are saying, 'Frankly, Parris had no other choice. At least he's one of our own.' "