Anne Arundel County Executive John Leopold is on trial for allegedly misusing his security detail for his personal and political benefit. (Astrid Riecken/For The Washington Post)

John R. Leopold spent decades trying to get voters’ attention. He ran for office 11 times in two states over the course of more than 40 years, sent countless notes to constituents, put up political signs, knocked on thousands of doors.

He now has voters’ attention — just not in the way he expected.

For the first time in his political career, the Anne Arundel County executive has the public riveted. Allegations of parking lot sexcapades and urine-filled coffee cans have done more to boost Leopold’s name recognition than his campaigning ever did.

The second-term Republican is on trial in Annapolis for allegedly misusing his security detail for his personal and political benefit. If convicted, he could be removed from office and potentially serve time behind bars.

For the past four years, Leopold has fought off allegations of sex discrimination and sexual harassment by former employees. The public scrutiny picked up when he was indicted in March. At his misconduct trial, which is expected to end this week, Leopold walks a daily gauntlet of television cameras. His name is in the newspaper. He even has his own Twitter hash tag.

Leopold, 69, has spent his entire adult life running for or serving in elected offices. Among his many job titles are state senator (in Hawaii), state delegate (in both Maryland and Hawaii), gubernatorial candidate, county executive and, during a brief hiatus from politics, freelance public relations writer.

In Anne Arundel, Leopold is famous for being a one-man political machine. He bankrolls his campaigns with his own money. He rarely hires paid staff. He puts up his own signs, mails his own campaign literature, and stands in busy intersections, holding a signature red sign like a human billboard.

“He campaigns 340 days a year. He leaves notes. He is good at saying, ‘I hope your plants are doing well,’ ” said Dan Nataf, director of the Center for the Study of Local Issues at Anne Arundel Community College. “It’s the kind of retail politics that you don’t expect in a large jurisdiction.”

Leopold has made less of a mark as an elected official. He has earned praise for rejecting mandatory raises and furloughing county employees to avoid layoffs, but he can be slow to weigh in on controversial topics, such as the expansion of gambling in Maryland. He strives to stay within what Nataf dubbed “the benign middle.” (The one big exception was the 1980 Republican convention, where his vocal support of the proposed Equal Rights Amendment to the Constitution made national news.)

That image, however, might not survive the trial.

Leopold’s former scheduler described having to drain his catheter bag into a coffee can several times a day, until she saw him bend down to tie his shoelaces and realized he could have been doing it himself. Several former protection officers said that Leopold had them work overtime to put up campaign posters and to keep one girlfriend from finding out about another while he was hospitalized in 2010. One former member of the detail alleged Leopold requested he compile dossiers on certain critics and potential rivals. Those files that are now the subject of a separate lawsuit.

Two officers told nearly identical stories about how they would drive to a bowling alley parking lot, check parked cars to make sure they were empty, then let Leopold out and wait for him to return from trysts in his girlfriend’s car. Sometimes, they said, Leopold would tell them how great the sex was.

Prosecutors said one of the alleged incidents alone might not be considered a crime, but the “cumulative pattern” added up to an abuse of authority.

Leopold’s attorney, Robert Bonsib, spent less time disputing what happened and more arguing how fuzzy the line can be between what is criminal and what is unsavory.

“What if he was a married man who went home for a nooner with his wife?” Bonsib said.

There have been times when defense attorneys have tried to cast the relationship between Leopold and his security detail as more of “a locker-room exchange” than an exercise in subjugation. One protection officer, Cpl. Mark Walker, admitted under cross-examination that he had shown Leopold an inappropriate photo of a woman Walker was having an affair with. But the officer said they were never buddies.

“You would share intimate details with someone who wasn’t your friend?” Bruce Marcus, another attorney for Leopold, asked.

Walker was quiet for a few seconds. Then he said, “It was my job to gain his confidence.”

At the defense table, no more than 10 feet away, Leopold had no reaction. He sat quietly, taking notes as if he were at a county council hearing. He sometimes got up to join his attorneys at the bench so he could hear them confer with the judge. In the hallways, he waved to reporters and greeted them by name. He handed one a copy of the 2006 Washington Post endorsement of him for county executive.

At one point, Leopold quibbled with a reporter for describing his appearance as stressed. “It’s not stress,” Leopold said emphatically, saying his back — on which he has had surgery — hurt from sitting too long. “I try to hide it,” he said.