MANILA, Philippines -- A Canadian man facing charges of illegal possession of firearms opened fire in a Philippine courtroom Tuesday, killing two people and wounding a prosecutor before police fatally shot him, officials said.

The suspect, John Pope, 63, appeared in court in central Cebu city, where he resided, to face the charges when he pulled out a gun and shot a lawyer and a physician who filed a case against him, police said. He then fired at a prosecutor in the hallway of the building before responding police fatally wounded him, said police Chief Mariano Natuel.

Regional police director Marcelo Garbo said Pope ignored orders to surrender and tried to fire at police.

The Philippine Star reported on its website Tuesday that Pope was carrying two firearms, a .357 revolver which he used to shoot the victims, and a .45 pistol police later recovered from a bag he carried.

Police said they were investigating Pope's background.

Local media mentioned Pope in 2011, when he was held by police on charges of illegal possession of firearms. The same physician who was killed in Tuesday's shooting accused Pope, his neighbour, of brandishing a weapon and threatening him and other residents in their condominium.

Pope was quoted as saying at the time that the pistol he was carrying was for self-defence. Apart from illegal weapons possession, he was also charged with malicious mischief and grave threats.

The shooting came after several recent killings in the country that prompted calls for a tighter gun control.

With files from The Canadian Press