BRANDON, Man. -- A Manitoba teenager who promoted terrorist activity online and urged people to "strike from within" apologized in court Tuesday and said he had not thought about the possible outcomes of his actions.

"I regret what I've done ... I was struggling with my identity," the 17-year-old, who cannot be identified because of his age, told his sentencing hearing in a Brandon court.

"I didn't think ahead (about) my actions."

The teen pleaded guilty earlier this year to counselling the commission of an indictable offence for the benefit of, at the direction of, or in association with a terrorist group.

He has been in custody since his arrest a year ago. The hearing was the first time details about the case were made public.

Crown attorney Ian Mahon said police were contacted by a CBC reporter about a Twitter account belonging to someone who was preparing to head overseas to fight for the Islamic State.

The teen initially denied being behind the account, but later admitted to it, Mahon said. The teen had urged people to join him in a migration overseas he referred to as Hijrah.

"One of the posts that caused a lot of concern that (the teen) made was, and I quote, 'For those who cannot make Hijrah, strike from within. It doesn't matter how you do it -- use a bomb, a gun, a knife, a car or a big rock,"' Mahon said.

The teen did not have a job or a passport but had been in contact with someone who identified as an Islamic State fighter and had talked about potential attacks in Canada, Mahon said.

"He indicated that anyone who was involved with the government was a legitimate target. He was going to target government buildings, monuments, infrastructure such as electrical grids, and federal employees."

Defence lawyer Saul Simmonds told court the teenager has been undergoing treatment and has family members are determined to help and supervise him.

"There are many people, unfortunately, who are sort of taken in by things that they see on the Internet. I think, for much of it, that's what happened to (the youth)."

The Crown and defence have agreed to jointly recommend a 14-month sentence -- minus the 12 months the boy has already been in custody -- followed by seven months of intense supervision and treatment and then two years of probation, with two dozen conditions that include restrictions on Internet activity.

But the Crown wants the teen monitored with a GPS tracking device for the entire period, while Simmonds wants the tracking device to be taken off once probation starts.

The hearing is scheduled to continue in January.

The youth was arrested a few months after the arrest of Aaron Driver in Winnipeg. Driver was placed under a peace bond intended to limit his activities and moved to southwestern Ontario.

Despite the peace bond, Driver, who was 24, was able to obtain explosives, plan an apparent attack in a public area and film a martyrdom video.

Police were tipped off about his apparent plan by the FBI. He was killed in August in a confrontation with police as he got into a taxi.