BEIJING — At least eight people were killed and seven wounded when a man in a rural part of northwest China attacked fellow residents with a knife before being arrested, the police said Wednesday, as the country was celebrating the Lunar New Year.

A brief police account of the attack on Tuesday in semirural Huining County, Gansu Province, left many questions unanswered, including the identities of the victims. But the local public security bureau said that the attacker, a 49-year-old man surnamed Guo, had been drinking and suspected his wife of having an affair.

“According to Guo’s initial confession, he suspected his wife of engaging in illicit sexual relations,” the police report said. It did not give his full name, occupation or other details. “Hatred festered in his heart and he deliberately sought revenge.”

Mr. Guo had been drinking, the account said, and early Tuesday morning he entered another villager’s home with a knife or cleaver and began attacking. The account did not make clear whether he went to more than one home or whether those killed included his wife or other relatives. The police said they were still investigating.