The teenage suspect in a mass shooting in rural British Columbia had been the subject of a number of police visits in recent years because of mental health issues, authorities say.

Police say the 18-year-old - who was found dead on the scene from a self-inflicted gunshot wound - killed eight people, including six children, in Tuesday's attack in Tumbler Ridge.

Jesse Van Rootselaar had previously been apprehended and assessed under the Mental Health Act and used to have a firearms licence.

It is unclear who owned the guns used in the attack or what the motive was. Prime Minister Mark Carney has said he will visit the mountain town in the coming days.

British Columbia, in western Canada, proclaimed Thursday a day of mourning across the province.

Five students aged 12 to 13 and a 39-year-old teacher were killed, and at least 25 others were injured at Tumbler Ridge Secondary School.

Two others - the suspect's mother and 11-year-old step-brother - were found dead at a nearby home, where the attack began.

Royal Canadian Mounted Police (RCMP) revealed there was a history of visiting Van Rootselaar's family home in the past several years because of the suspect's mental health struggles. Deputy Commissioner Dwayne McDonald stated, On different occasions, the suspect was apprehended for assessment and follow up.

Authorities found a long gun and a modified handgun on the scene, although they are still investigating how the weapons were procured.

The RCMP also mentioned that guns had been seized from the suspect's home around two years ago, but were later returned to the family.

This incident underscores the urgent need for effective mental health strategies and gun control measures to prevent future tragedies.

The community continues to mourn as flags fly at half-mast and vigils take place across the province.