The body of a male black bear shot and killed in Scarborough on the weekend will be used for educational purposes, says Ontario's ministry of natural resources.

Jolanta Kowalski, spokesperson for the ministry, said an autopsy will be done on the bear. A veterinarian has obtained a tooth and it will be used to determine the age of the bear, which wandered into a residential area in Scarborough and was tracked by police for nearly four hours before it was killed in a backyard.

"The carcass will be used to support education on black bear biology," Kowalski said in an email. "A tooth was taken and we'll get it to the lab for aging. Getting the age of the bear will require further analysis."

Kowalski acknowledged that many Toronto residents are angry that the bear was killed, but said public safety is paramount whenever there is wildlife in populated areas.

"It's unfortunate the situation couldn't be resolved without the death of the bear, but we do not second guess the police and their actions when it comes to public safety. There is no guarantee that the bear could have been saved even during daylight hours, if it became a threat to the safety of the public."

If the bear had been up a tree or contained in an area, staff could have attempted "chemical immobilization" and then relocated the bear away from the city, she said.

A black bear climbs over a fence. Here is another still taken from a YouTube video of what is believed to be the Scarborough bear. (Alex Brown/YouTube) Kowalski claimed ministry staff were available during the incident and provided police with information and advice. But they did not go to the area where the bear was roaming at night to try to sedate it because the situation would have been considered "too dangerous," she said.

"We will assist police at their request but only respond to a specific site during daylight hours. Trying to chemically immobilize at night is too dangerous."

The bear was first spotted in the area of Tapscott Road and Finch Avenue East on Friday night after 10 p.m. Police shot and killed it near McCowan and Middlefield roads at about 2 a.m. It walked through the neighbourhood, rummaging through garbage cans. ​

A black bear surveys the scene in Scarborough. This is yet another still taken from a YouTube video. (Alex Brown/YouTube) It is not known where the bear came from, Kowalski said.

"During spring time, juvenile bears can travel great distances looking for food. Bears can move fairly undetected through natural corridors such as farm fields, ravine systems, rail corridors."

The Toronto Police Service, however, said they contacted the ministry, along with the Toronto Zoo and the Toronto's Animal Services, and no one would help out.

"None of the three agencies was able to assist us," Mark Pugash, spokesperson for the police, said in an email.

"Public safety was our primary consideration. We felt we had no choice but to do what we did."

Pugash said police have no plans for a review of the incident.

According to Kowalski, the ministry works with Ontario Provincial Police and local police services to educate communities about bear behaviour.

The ministry has a Bear Wise phone line, a non-emergency reporting line, that is staffed 24 hours between April and November. The number is 1-866-514-2327. If a bear is considered a danger to the public, the ministry urges people to call 911 or police.