A Canadian man has been killed in Costa Rica in an apparent home invasion, police there have confirmed.

Brad Deering, 42, was shot outside his home in Escazu, near the capital San Jose, Costa Rican police said in a statement on their Facebook page.

The Department of Foreign Affairs has not confirmed the man's identity, only saying in an emailed statement that "our thoughts are with the family and friends of a Canadian citizen who passed away in Costa Rica."

It is believed Deering was from Vancouver because he lists the city as his hometown on his Facebook site.

Police say two gunmen — dressed as private security officers — broke into the gated community where Deering lived on Thursday.

They tied up a security guard, and attempted to burglarize the home, attacking four people inside. Deering was reportedly shot three times as he tried to escape.

Police say the suspects fled the scene, and that an investigation is underway.

Violence 'can happen'

Many foreigners who live in or visit Costa Rica regularly say the country is safe.

Violence "can happen… just like Vancouver or anywhere else," says Vancouverite Diederik Wolsak, who has run a wellness centre in Costa Rica for the past seven years.

"But it seems silly to think the whole country is full of home invaders that kill people," Wolsak added.

Since January 2011, two Canadian citizens have been murdered in Costa Rica, and eight foreign nationals — including one Canadian citizen — have gone missing.

The Department of Foreign Affairs warns Canadians to "exercise a high degree of caution and be vigilant at all times due to increasing levels of violent crime."

Canadian consular officials say they are in contact with local authorities to gather additional information and provide assistance to the family.