William G. Hillar billed himself as a hero and a patriot, a 28-year veteran of the Army Special ­Forces who shared his knowledge of counterterrorism by holding training sessions for federal agents and local police.

The 66-year-old Millersville man told people that he was an expert in human trafficking and drug trafficking. He said that his daughter had been kidnapped, forced into sex slavery and killed by her captors before he could rescue her. He said the movie “Taken,” starring Liam Neeson, was based on that experience.

It was all a lie.

“He was a con artist,” said Rod J. Rosenstein, the U.S. attorney for Maryland.

On Tuesday, a federal judge in Baltimore sentenced Hillar to 21 months in prison for crimes connected to his fabrication. Prosecutors say Hillar was paid at least $171,415 over more than a decade, beginning in 1998, for speeches and training on counterterrorism, drug trafficking and human trafficking. The FBI, local police and universities hired him for his supposed expertise.

Moments after his sentence was handed down, Hillar grimly walked within a few feet of two genuine warriors sitting near the front of the courtroom. He looked straight ahead, avoiding eye contact as he stepped past the men.

One of them, Jeff Hinton, who had served as a Green Beret, said Hillar’s training was worthless and put law enforcement officers at risk.

“We’re enraged,” said Hinton, who is a member of a fraternal group of Green Berets. “It made us mad. We’ve had people die in training trying to earn the right to be a Green Beret.”

Hillar, Hinton said, “was living off a reputation we forged in blood.”

In reality, Hillar served in the U.S. Coast Guard Reserve from 1962 to 1970, prosecutors said. But his claim that he served in Asia, the Middle East, and Central and South America isn’t true, according to court documents.

Hillar has no experience in counterterrorism, emergency medicine, human trafficking or psychological warfare, as he claimed, prosecutors wrote. He has a bachelor’s degree in psychology and a master’s degree in special education. He did consult on organizational issues for hospitals and stress management.

At some point, Hillar began billing himself as an expert lecturer. After the Sept. 11, 2001, terrorist attacks, he capitalized on the desire of law enforcement agencies and others to receive counterterrorism training, Assistant U.S. Attorney Leo J. Wise wrote in a sentencing memo.

During the hearing, Hillar, dressed in a gray suit, white dress shirt and tie, apologized. He also offered an explanation of sorts.

“I take full responsibility for what I did,” he said. “I apologize to those I hurt or demeaned. I never intended to hurt anyone, and I’m sorry.”

Hillar said he was passionate about the subjects he taught. Many people who took his classes or listened to his talks at workshops assumed he had served in the military, he said. The fiction grew from there.

“I never denied it,” Hillar said. “And after some years, I actually adopted it. I know that was wrong.”

Still, Hillar insisted, he is a patriot who visits Arlington National Cemetery on Memorial Day and Veterans Day, and goes to airports to greet veterans of the Iraq and Afghanistan wars when they return from tours of duty.

“It’s very difficult to admit to myself that I’m a fraud,” Hillar said.

Hillar was arrested in January and has pleaded guilty to one count of wire fraud. 

Among the organizations that hired Hillar were the FBI Command College, FBI field offices in Salt Lake City and Chicago, the Illinois State Police and the University of Oregon.

Hinton, who runs the Professional Soldiers Web site, said Hillar’s story began to unravel when someone who had taken one of his courses asked a retired Special Forces sergeant major whether he had ever heard of Hillar.

In court papers, Wise wrote of the service of Special Forces members in Iraq and Afghanistan and cited the deaths of 30 U.S. troops, including 17 Navy SEALS, when their helicopter was downed by insurgents in Afghanistan this month.

Hillar, Wise wrote, “must be punished for trying to expropriate those sacrifices for personal gain.”