A Canadian army captain accused of shooting and killing a severely wounded insurgent after a deadly battle in Afghanistan was released from custody at a military hearing in Petawawa, Ont., on Wednesday afternoon.

Capt. Robert Semrau, 35, will be allowed to rejoin his unit at Canadian Forces Base Petawawa and live at home with his family in nearby Pembroke, Ont.

Lt-Col. Louis-Vincent d'Auteuil, who presided over the hearing, granted a joint request from both the defence and prosecution to let Semrau stay at home while he awaits trial on a single charge of second-degree murder.

But the judge did, however, order the accused soldier to surrender his passport and refrain from communication with five Canadian soldiers and members of the Afghan National Army.

Semrau is also prohibited from using weapons or explosives -- even while at work for the military -- unless approved by the court.

The charges against Semrau were announced at a news conference on Dec. 31 -- the same day he was formally charged.

On Dec. 31, Canadian military officials said the Canadian Forces' National Investigation Service would be investigating whether proper procedures were followed surrounding the death of a suspected Afghan militant.

Officials said Col. Jamie Cade, the acting commander of Task Force Kandahar, was notified of the allegations only four days before the press conference, at which point he quickly notified the NIS and an investigation was launched.

The timing of the charges are unusual because they were laid about two-and-a-half months after the alleged incident for which Semrau has been charged.

Semrau was in Helmand province when the alleged incident occurred, as one of several military mentors there while a violent three-day defence of Lashkar Gah was carried out.

During the battle, a group of Afghan and Canadian soldiers were ambushed by Taliban in Helmand province.

Before the alleged shooting, the group had called in air support, which included a U.S. Apache helicopter, court heard on Tuesday.

After the chopper completed the air strike, the Canadian and Afghan soldiers found one dead insurgent and another who appeared to be severely-wounded.

According to court documents, the wounded insurgent had a rifle, which was taken from him, and that it was determined his injuries were untreatable.

Witnesses quoted in court documents say that Semrau was seen near the injured insurgent before two shots were fired.

Crown prosecutor Maj. Marylene Trudel accused Semrau of firing both shots.

The Afghan and foreign troops eventually won the battle, retaking the Nad Ali district centre after three days of fighting.

But the insurgent's body was left behind and has never been found, and Trudel said military prosecutors have not yet determined if there is a reasonable prospect for a conviction.

She said the charges against the Semrau could change as the investigation continues.

"We're still a step behind that process," she said Tuesday.

Semrau, who was brought back to Canada for a court martial after charges were laid, is alleged to have shot the unarmed man "with intent to kill."

Tuesday's court proceedings also revealed that Semrau earned a BA in psychology from the University of Saskatchewan. He is married and has an infant child.

Before his time with the Canadian Forces, he previously served three years with the British military, which granted him an "exemplary discharge" when he left.

With files from The Canadian Press