Toronto suffered one of its worst-ever mass shootings Sunday night when a gunman opened fire in the city’s Danforth neighbourhood, killing a 10-year-old girl and an 18-year-old woman and injuring 13 others.

The 29-year-old suspect allegedly started shooting at crowds of people near Danforth and Logan avenues just after 10 PM. He was later found dead, though it’s not clear if he killed himself or was killed in a shootout with police.

Police say he was carrying a handgun. Details are scant and it is not clear whether or not the suspect obtained the gun legally.

The shooting comes at a time when Toronto has been struggling with how to curb gun violence. As reported by VICE News, there have been more than 220 shootings this year, and more than 286 victims. As of July 16, 27 of the city’s 55 homicides were due to shootings. There had been 17 gun homicides in the city in the same time period last year and 61 homicides for the entire year.

Speaking at a press conference Sunday night, Mayor John Tory said guns are too readily available in Toronto.

“There are far too many people carrying around guns in our city and our region who should not have them,” he said. “Why does anyone in this city need to have a gun at all?”

According to the RCMP, there were 288,165 restricted firearms owners in Canada as of June 30, 2018. Restricted guns—which are registered and tracked by the government—include handguns and semi-automatic rifles. That number does not include owners of non-restricted guns, e.g. long guns, which are no longer registered by the government.

Statistics Canada data from 2016 showed that of a total of 223 firearms-related homicides that year, more than half were committed with handguns while 13 were committed with sawed-off rifles or shotguns. It also showed 54 percent of gun homicides that year were gang-related.

Two recent “lone wolf” mass shootings in Canada have involved handguns. Alexandre Bissonnette, who killed six men at a Quebec City Mosque in 2017, was a legal firearms owner, and had four firearms on him during his shooting spree, two handguns and two rifles. Phu Lam, who shot eight people dead in Edmonton in 2014, used a stolen handgun.

Other recent mass shooting sprees included the 2014 Moncton shootings, in which three RCMP officers were attacked by a man carrying a rifle and shotgun. In 2016, a 17-year-old boy shot four people dead with a rifle and a shotgun in La Loche, Saskatchewan.

Mass shootings are still a rare occurrence in Canada, especially when compared to the US. Most US states don’t require a permit to purchase a handgun or registration of firearms. Laws for open carry, allowing citizens to openly carry a gun, and concealed carry vary from state to state, with some requiring permits.

Canada has a rigorous process to become a legal handgun owner. It is not legal to open carry or conceal carry a handgun in Canada.

VICE reached out to firearms experts to ask the key features of handgun control in Canada.

Safety course

Canadians 18 and older who want to buy a handgun must first take a two-day safety course for non-restricted guns, pass a test, and then take another additional course and test for restricted guns. They must pass with a grade of 80 percent or more.

Background check

After passing the test, Canadians can apply for a Possession and Acquisition Licence (PAL) for restricted firearms. An application requires a photo, references, disclosure of mental health history, criminal history, and current/prior conjugal partners. Having said that, it is possible to lie about things like your mental health history. The RCMP will do a background check to look for criminal records. In some cases, they may interview a person or their references. The fee is $80.

Waiting period

There’s a minimum 28-day waiting period for people who don’t already have a valid gun licence.

Shooting club membership

Because Canadians can only legally buy a restricted firearm for target shooting in Canada, they have to join a shooting club in order to get an Authorization to Transport (ATT), which gives permission to travel with a handgun.

Buying a handgun

To purchase a new handgun, a Canadian has to present their licence at a gun store. The store still has to contact the firearms centre, who will speak to the buyer to verify their identity and that they want to purchase the gun in question. They will then issue a temporary transfer that allows the buyer to take possession of the gun—it usually takes a few days. It still takes a few weeks for a buyer to receive the registration certificate for the gun. To buy online, the buyer would have to first get set up with an online gun dealer, which requires scanning and sending in a copy of their PAL and gun club membership.

Transporting a handgun

Unlike the US, Canada places severe restrictions on transporting handguns. Owners are required to have an Authorization to Transport that allows them to move their restricted gun using the most direct route to and from one of five places, said Rod Giltaca, executive director of the Canadian Coalition for Firearm Rights. Those places are: the owner’s house, a border crossing (just up until the nearest border crossing, it doesn’t authorize someone to transport guns across the US border), a gunsmith, a peace officer to turn in a firearm for destruction or to have it verified, and an approved shooting range in the owner’s area. It’s a federal offence to take a restricted gun places other than those approved by the ATT.

Storage

Restricted gun owners must store their gun in one of two ways. Either unloaded with a trigger or cable lock in a locked box—ammo in the box is OK, or unloaded in a safe—ammo in the safe is OK. When transporting a restricted gun, it must be unloaded with a secure locking device on it, such as a trigger or cable lock, and it must be in a locked case that can’t accidentally open during transport.

Authorization to carry

Some Canadians including police and border guards are legally allowed to carry handguns. Aside from that, civilians who can demonstrate they need to carry a handgun for their job or protection of life can apply for an authorization to carry. A.J. Somerset, author of Arms: the Culture & Credo told VICE “you have to be able to demonstrate there is an imminent and recognizable, credible threat which the police cannot protect you from” in order to qualify for an authorization to carry. They are commonly issued to armoured guards, he said. Trappers or people who work in the remote wilderness can also apply for an authorization to carry.

Follow Manisha Krishnan on Twitter.