A Canadian man has opened fire in a Philippine court, killing two people and wounding another, police say.
The 65-year-old Canadian national, named as John Pope, was also shot and died from his wounds, officials say.
The incident took place in Cebu city on Tuesday morning. Reports say Pope was facing charges of malicious mischief filed by his neighbours.
A doctor and his lawyer were killed inside the courtroom and a prosecutor wounded in a corridor, reports say.
One report said that the doctor shot dead was a complainant in the case.
"We are investigating how the suspect managed to bring in the gun," regional police chief Marcelo Garbo told local radio.
Prosecutor General Claro Arellano said there had been a "serious lapse in security", Associated Press reports.
It is not clear whether the Canadian man shot himself or was shot by police, or both.
The shooting comes amid a debate in the South East Asian nation over gun control after a series of recent shootings, including one earlier this month that left seven people dead.
Police figures show there were 1.2 million registered firearms in the Philippines last year, and about half that number again of unlicensed weapons, AFP news agency reports.