Dozens of people had been inside the church for a funeral when the shooting began, local media report.