Virginia’s longest-serving commonwealth’s attorney, Paul B. Ebert, was honored at the Prince William County courthouse Friday in recognition of his more than 40 years on the job.

A portrait of Ebert was unveiled at the event that will be hung near his office alongside those of his predecessors. The portrait was done by Wendell Powell Studio in Richmond.

The idea of a portrait came from the many people Ebert has known in his 43 years as a commonwealth’s attorney.

“We see all these nice, distinguished gentlemen hanging [on the walls] around the courthouse,” Prince William area lawyer William Stephens said. “It dawned on me” that Paul Ebert should be one of them. “He has touched so many people.”

When Ebert was elected to the position in 1968, he was the youngest commonwealth’s attorney in the state, colleagues said. At 73, he is now the oldest.

Over the decades, he has prosecuted drug, murder and child-abuse cases. He has incarcerated numerous criminals and sent more than a dozen people to death row. He is perhaps most well-known as the prosecutor in the death penalty case of Washington area sniper John Allen Muhammad. But he has also been a supporter of programs that provide alternatives to jail for some nonviolent felons.

“He’s very fair,” said Ebert’s son, Pete. “He’s always said the law shouldn’t be so stringent that you don’t give somebody a second chance. He’s also never lost his belief in humanity, even though he’s seen the darker side of it.”

Friends said Ebert has maintained his position for so many years because he is tough but fair. He is respected across the country, and although he’s serious in the courtroom, he’s also quick to crack a joke.

His sense of humor didn’t disappoint the crowd of more than 50 people Friday.

“I’m honored, but usually this doesn’t happen unless you’re retired or dead,” Ebert said. “I wish you would have done this when I had more hair.”

Ebert was born in Roanoke and moved to Northern Virginia when he was a child. He has a degree in business administration from Virginia Polytechnic Institute and a law degree from George Washington University.

Ebert previously served as a justice of the peace for the City of Falls Church and as the assistant commonwealth’s attorney in Prince William.

Stephens, who helped spearhead the portrait idea, said he met Ebert in 1965 and still recalls one of the first things Ebert said to him.

“I had told him I was from West Virginia,” Stephens said. “And he said, ‘Do you know what’s the best thing to ever come out of West Virginia? An empty Greyhound bus.’ ”

Stephens, who served as an assistant commonwealth’s attorney when Ebert took office, said Ebert is genuine and that “what you see is what you get.”

Friends said Ebert has a passion for his family — which includes his son and two daughters — and fishing. He has also been a role model for the 20 assistant commonwealth’s attorneys he oversees and for the almost 150 he has managed during his tenure.

“When I started working, I asked if he had any [advice] for me,” said Leroy F. Millette Jr, a justice with the Supreme Court of Virginia. “He said, ‘Just do what you think is right.’ That’s the kind of person we are here to honor today.”

Ebert said the past 40-plus years have gone by quickly, and it didn’t feel like work. He attributes his success to his staff.

Looking back, Ebert said, the sniper case was one of the most complex and notorious cases he has prosecuted. Ebert was picked by former attorney general John Ashcroft to prosecute Muhammad, who was found guilty and executed in 2009.

Ebert is a member of many associations and the recipient of numerous awards. And he’s not done. Ebert said it is “very likely” he will run for another term.

“I hope we can continue working [together], but one day I may not be around,” Ebert said during the event. “But my portrait will still be here, and people will look at it and say, ‘Who is that old bird?’ ”