Former Canadian brigadier-general Daniel Menard, who was demoted over a sexual relationship with a subordinate and now works for a private security firm, could be released from an Afghan jail within days after being detained for three weeks, CTV News has learned.

Menard, who serves as GardaWorld’s managing director for Afghanistan, has done “nothing wrong,” a source told CTV’s Mercedes Stephenson.

That source says it is not uncommon for foreign contractors to be jailed in Afghanistan due to government corruption.

The source says Menard has his authority for release, which needs to be stamped by Afghan authorities, and he could be out by the end of the weekend, if not sooner.

Menard has been with GardaWorld since Nov. 2011, according to his profile on the company’s website.

As part of the job, Menard oversees GardaWorld’s “commercial, operations and projects throughout the country, including existing and new contracts with the U.S. government, non-governmental and commercial clients.”

In a statement to CTV News, a spokesperson for the Department of Foreign Affairs said department officials “have been in contact with the subject, and are providing him with consular assistance.”

Menard led Canadian Forces in Afghanistan before being stripped of his command and sent home in June 2010 after an affair with a subordinate came to light.

Military rules prohibit sexual relations between soldiers while deployed, even if they are married.

Menard, who was married with two children, began an affair with Master Cpl. Bianka Langlois after they met in Canada in 2008. Their relationship carried on after they were deployed to Afghanistan between Nov. 2009 and Apr. 2010. The affair became public in May 2010 and Menard was sent home. He was to assume command of the army in Quebec. However, he resigned that November and left the military the following month.

Menard pleaded guilty to having improper relations with a corporal under his command and attempting to impede an investigation into the relationship.

In July, 2011 Menard was fined $7,000 and demoted to colonel, though the reduction in rank was symbolic because Menard had already retired.

For her part in the affair, Langlois was convicted of one count of conduct to the prejudice of good order and disciplined and fined $700.