Police in Kelowna, B.C., are praising a teen for his quick thinking to help stop robbers who were ransacking his home in a scenario reminiscent of the movie Home Alone.

The 14-year-old boy was by himself in his home getting ready for school Tuesday morning when he heard the sound of men kicking in a door to enter the house.

Police said the boy fled to his bedroom and hid in his closet with his iPod.

"The males that were in the house were going through the other bedrooms. The 14-year-old was savvy enough to use his iPod and send out text messages," said RCMP Cpl. Tanya Carroll.

The teen exchanged texts with a school friend, who then called 911.

Police arrived to find the robbers fleeing, but one man was taken into custody as he tried to climb a fence in the backyard.

Neighbour Allan Sieb said the experience was terrifying for the boy and his mother, who rushed home from work when she heard the news.

"Mom was upset 'cause they got in the house," Sieb said.

Sieb said he thinks the men were scouting the neighbourhood because another neighbour told him the men had pounded on his door Tuesday morning as well.

Carroll praised the teen's quick thinking, saying he did the right thing under dangerous circumstances.

"Anybody who's in a house when someone breaks in to steal your stuff is going to be terrified. But for him to be 14 and in the house by himself was even more terrifying."