BEIJING  - At least eight people were killed and three seriously injured after a mosque being built in northwest China collapsed, state media reported on Friday. The mosque collapsed in Taer, a town of 38,000 people mainly from China's ethnic Hui minority in Qinghai province, on Thursday afternoon, Xinhua news agency said, citing local authorities. Rescuers said 31 people were in or near the building when the mosque collapsed, according to Xinhua. One of the dead was a young boy, it said. "The child was an eight-year-old village boy who was playing around the construction site, when the mosque suddenly collapsed," said Han Lutai, an imam who raised the funds for the new building, according to Xinhua. Police have detained a building contractor in connection with the collapse, the report said. Seven of the victims died at the scene, while one died after failing to respond to hospital treatment, said an official with the Qinghai emergency rescue bureau, it said. The three badly injured people were still in critical condition on Friday while 20 others suffered minor injuries. Han said the construction of the mosque was approved by the county government and was almost finished after beginning in May 2007. Officials have ruled out three earthquakes that struck the nearby province of Sichuan on Thursday as the cause and are investigating the possibility a supporting beam may have collapsed, the report said.