A Maryland man was sentenced on Tuesday to 21 months in federal prison and ordered to pay $171,000 in restitution after admitting that he had fraudulently posed for 12 years as a US Army special forces veteran and terrorism expert.

William Hillar used false claims about his background and academic credentials to win teaching and training contracts from 1998 to 2010.

Among the organizations he duped: the Federal Bureau of Investigation Command College, which paid him $17,369 from 2000 to 2010, according to court documents.

Mr. Hillar claimed to be a retired US Army colonel who served in the special forces from 1962 to 1990. His website said he’d been stationed in Asia, the Middle East, and Central and South America.

The website listed his specialized skills as “tactical counter-terrorism, explosive ordnance, emergency medicine, and psychological warfare.” Hillar also advertised that he had earned a PhD from the University of Oregon.

None of it was true.

“William G. Hillar claimed that he had earned praise as a hero, but the truth is that he deserves condemnation as a liar,” said US Attorney Rod Rosenstein in a statement after the sentencing in federal court in Baltimore. “He did not serve in the US Army, did not receive military training in counter-terrorism and psychological warfare, and did not lose his daughter to sex traffickers.”

One of Hillar’s most outrageous claims was that his own daughter had been kidnapped, forced into sexual slavery, sodomized, and tortured before being hacked to death with machetes and thrown into the sea. Hillar, of Millersville, Md., claimed that his daughter’s brutal murder was the basis of the 2008 movie “Taken.”

In his plea agreement, Hillar admitted that his claims were false, including about his daughter, who officials say is alive and well.

Hillar, 66, served from 1962 to 1970 in the US Coast Guard. He left the service as a radarman, petty officer 3rd class.

Hillar’s scam was uncovered by members of the special forces community. An FBI investigation resulted in Hillar’s arrest in January.

Court documents identify the institutions he defrauded and list the amounts he allegedly was paid for lectures or workshops.

They include: University of Oregon, $33,025; Monterey Institute of International Studies, $32,500; Federal Executive Board of Los Angeles, $27,140; Montana Sheriff and Peace Officers Association, $9,500; Utah Valley State College, $8,430; California Firefighters Association, $6,208; State Training and Audi Resource Seminar (STARS) 2007 conference, $4,000; US Army, $3,625; Drug Enforcement Administration, $2,400; FBI Salt Lake City Division, $1,010; and the FBI Chicago Division, $1,000.

In addition to requiring repayment of the fraudulently obtained fees, US District Judge William Quarles ordered Hillar to conduct 500 hours of community service with the Maryland State Veterans Cemetaries.

Hillar’s activities were also scrutinized by members of the Defense Criminal Investigative Service, in addition to the FBI.

“The service members that comprise the Department of Defense’s elite special warfare units have undergone years of specialized training and sacrifice to be called special forces,” said Robert Craig, chief of the DCIS’s mid-Atlantic field office. “To misuse their titles for personal gain is unconscionable and discredits those that served, and continue to serve, the United States of America.”