E-mail this article

Sending your article

Your article has been sent.

WELLFLEET — Making his way through the crowd at last weekend’s Oyster Festival in pursuit of votes for his congressional race, Norfolk District Attorney William R. Keating bumped into a fellow in a leather jacket with a long gray ponytail.

“Eddie!’’ he shook the man’s hand. They had gone to high school together. “How are you doing! . . . Ames Court.’’

Keating wasn’t his neighbor, or even a close friend, but Ed Schnurr’s childhood home was imprinted on the candidate’s mental map of the mail routes in Sharon he had run four decades earlier. It was testimony not only to Keating’s youthful industriousness — he put himself through college working for the US Postal Service — but also to his early political ambition. Becoming a friendly postman helped him beat two local selectmen for a seat in the state House of Representatives at age 24.

“He made so many friends along the postal routes, filling in for different people,’’ his close friend and former law partner Joel Fishman recalled.

Keating, who has never lost an election, is now embroiled in a tight race with state Representative Jeffrey D. Perry, a Republican from Sandwich, to replace retiring US Representative William Delahunt in the 10th Congressional District. But Keating’s old mail routes will not wont help, nor will a great portion of the political base he has he’s built since; only three of the 10th’s 41 communities are in Norfolk County. Keating rented a house in Quincy, where he will campaign next Saturday with Vice President Joe Biden, to seize the rare chance to run for an open congressional seat.

Keating, 58, has amassed a substantial record on criminal justice, public safety, and environmental protection in his eight years in the state House, 14 in the state Senate and 12 as Norfolk district attorney. But in a volatile election year in which anti-establishment Tea Party candidates are appealing to a frustrated and short-tempered electorate, his biggest liability may be the political resume he spent a lifetime building.

So Keating has tried to make the race about trust.

In virtually every public appearance, he steers the conversation to Perry’s role in illegal strip-searches of two teenage girls by an officer under his command in the early 1990s, when Perry was a sergeant in the Wareham Police Department. He seems genuinely incredulous that Perry — who also has previously misstated his academic credentials and inaccurately described the strip-searches on his bar application — is doing as well as he is.

Keating’s candor seems involuntary, if not always politically adept. At the Oyster Festival, where he was struggling to gain ground with Cape voters, he was asked whether he liked oysters.

Surrounded by briny samples of the town’s pride piled in dinghies, simmering in stew, emblazoned on sweatshirts, and painted on crockery, he said, “No.’’

Meeting voters on the trail on the Outer Cape last weekend with his wife, Tevis — who brought along their two Malteses, Annie (with bows in her hair) and Casey (without) — he was affable, if remarkably low-key for a candidate in the final days of a tossup race. When a man in Provincetown told him he was sick of both parties, Keating produced a business card: “Go to my website, you might see something in between.’’

Keating developed a taste for government work early. His father, a Seabee in the Navy during World War II, had a side job as a veteran’s agent, visiting veterans to make sure they were getting their benefits. He loved watching his father — and the Veteran’s Administration benefits he helped people obtain — fix their problems.

At 23, Keating was still living with his parents and earning his MBA at Boston College when a local House seat opened. He jumped at the chance to run. His family, who had deep roots in town, and their vast network of friends pitched in. On election night, said his brother James Keating, a retired police officer, “The house was bulging with people . . . you couldn’t park two or three streets away.’’

In the next two decades, Keating toggled between the state House and, after earning his law degree from Suffolk University, building a small law practice with Fishman.

In the state Legislature, he took on leadership positions in public safety and criminal justice. He became one of the House’s strongest champions of gun control, backed stiffer penalties for drug offenses, and championed victims’ rights. He was an early supporter of gay rights. Elected to the state Senate in 1984, he also worked on environmental protection, co-authoring major legislation to reduce water pollution.

But perhaps the most vivid episode in Keating’s legislative career is the one he now cites as evidence of his “willingness to stand up to his own party in favor of tough but necessary reforms’’ — his 1994 challenge of William M. Bulger for the Senate presidency.

Keating was among a small group of senators who, in Bulger’s 16th year as president, had begun to chafe under what they saw as his repressive regime. They pressed for overhauling Senate rules that they felt gave Bulger near-dictatorial power.

In fall 1993, they figured that, with the cooperation of freshmen who had ran on anti-Bulger platforms the year before, they could unseat him. Keating would be their candidate.

Caught by surprise, Bulger was livid. So were most of his Democratic colleagues when Keating and his allies warned them that if they backed Bulger, they could face primary challenges.

A press conference was planned at the Parker House to announce Keating’s candidacy in October 1993. He thought he would have at least eight colleagues beside him. By the day of the announcement, the insurgency had shrunk to six.

“We had ‘The Keating Seven,’ ‘The Keating Eight,’ ‘The Keating Nine,’ we had these buttons ready to go, like there would be more of us,’’ Keating recalled with a rueful smile. “But it went in the other direction.’’

Bulger said in a recent interview that Keating’s real motivation was revenge — the Senate president had denied him chairmanship of the powerful Ways and Means Committee. Bulger said he regarded Keating’s political consultant, Michael Goldman, as a more dangerous adversary than Keating himself.

“I don’t want to describe Keating as a gnat — but it was kind of like that,’’ Bulger said. “Sort of a nuisance, you know.’’

Keating sympathizers at the time disagree.

“People complain politicians play it safe, play the inside baseball game,’’ said Michael Barrett, who represented Cambridge then.

Keating “was willing to go in a different direction, and you can’t deny the courage that took,’’ he said.

None of the pro-Keating challengers beat pro-Bulger incumbents in the primaries. One of them, James J. Fiorentini, now mayor of Haverhill, recalls how his platform puzzled voters in his district.

“What I learned from that campaign was that people care about local issues,’’ he said. “I remember a reporter from the Haverhill Gazette saying to me, ‘I saw your sign, “Let’s beat Bulger.’’ Are you moving in to Bulger’s district?’ ’’

Keating’s old allies say now that they lost that battle but won the war; the Senate adopted a number of changes that they had sought. But soon Keating was ready to leave.

By the spring of 1996, Delahunt, the Norfolk district attorney, was running for Congress, and Keating was among the first to announce he would run if Delahunt won.

Though never a prosecutor, Keating pointed to his legislative work on behalf of crime victims. Two years later, he beat Jeffrey Locke, whom Governor Paul Cellucci had appointed as an interim district attorney after Delahunt left.

Keating immediately ruffled feathers by jettisoning some of Delahunt’s top deputies. Though Keating said he kept 70 percent of Delahunt’s staff, that badly strained his relationship with Delahunt.

As district attorney, Keating has tried to address crime more holistically than some prosecutors. He has launched programs, for example, to help police officers recognize and respond to children with autism, veterans with post-traumatic stress disorder, and people with mental illness.

“I don’t look at the criminal-justice system as simply putting bad guys away,’’ Keating said in a recent Globe interview.

The toughest criticism of Keating’s tenure came in a 2005 analysis by the Patriot-Ledger showing that Keating’s office was more likely to reach plea deals than the Plymouth district attorney’s office, and that perpetrators charged with rape in Norfolk County went to jail less often, the newspaper found, and for shorter periods.

Keating calls the report’s statistical method flawed; he also said he preferred to extend the probation period for sex offenders — if necessary, at the expense of longer jail sentences — in order to supervise the perpetrators longer after their release.

Laurie Myers, cofounder and president of Community VOICES, which monitors sexual assault cases statewide, praised the recent opening of the Norfolk Advocates for Children, a project Keating pursued for years, in which social-service workers, police, prosecutors, and health care providers work together on child-abuse cases to minimize the trauma to the victim.

Myers said prosecuting sexual assault cases can be difficult if a victim is not willing to testify, but she also said the Patriot-Ledger report concerned her and that Keating should explain the numbers further. Though she called Keating’s staff highly competent, she said she wishes he were a more zealous public advocate on the issue.

But Colby Bruno, managing attorney for the Victim Rights Law Center in Boston, which provides legal services for sexual assault victims, had only praise for Keating and his office.

“They treat the victims with a great amount of respect, and that generally comes from the top down,’’ she said. “They have great victim witness advocates, and strong and sensitive prosecutors.’’

One of Keating’s toughest dilemmas as district attorney came this year, when he had to decide whether to pursue charges against Amy Bishop, who has been charged with killing three of her colleagues and injuring three others in a shooting spree at the University of Alabama in Huntsville. Bishop had shot and killed her 18-year-old brother in 1986 in Braintree, in what authorities then dismissed as an accident — even though Bishop fled the scene and tried to wrest a car from a nearby auto dealership at gunpoint.

Keating knew that Bishop, who is facing capital murder charges in Alabama, would probably never be tried in Massachusetts, but he pursued a judicial inquest and then an indictment. Some of his critics saw this as grandstanding; others saw it as a brave rebuke of Delahunt, the popular incumbent Democrat, whose office had handled the original case.

Keating said that in his mind he had no choice, but “it was tough.’’

He has even less say about the anti-establishment mood in the air this election season, but last week he said he is feeling increasingly good about his case to the voters: “I trust them, and I hope they are trusting me.’’