HAYWARD -- A man fatally shot by police officers after he reportedly tried to grab their guns during a motel confrontation over the weekend has been identified as a 29-year-old Hayward resident, police said Wednesday.

James McKinney was fatally shot by two veteran officers who were trying to detain him Sunday morning at the Phoenix Lodge, at 500 West A St., Lt. Bobbie Koller said.

The shooting took place about 4:06 a.m., after officers were called to the motel by a clerk who said a female tenant reported that McKinney had forced his way into a room where she had been staying with a former acquaintance of McKinney who is also a Hayward man.

Police said that when McKinney visited the third-floor room and refused to leave, a scuffle broke out in the room and the woman suffered a cut to her mouth and scrapes and bruises to her arms and chest that were reportedly caused by McKinney.

Police have not released what prompted the scuffle.

When two officers entered the motel room to confront McKinney, he appeared to be under the influence of a controlled substance and was acting erratically, police said. He did not listen to their commands to leave, Koller said.

"He lunged at them and grabbed both their guns, attempting to disarm them," Koller said. The officers both fired "to stop his aggression," police said.

The three shots fired at McKinney struck him in the upper body, Koller said.

McKinney was pronounced dead at the scene.

One of the officers who fired is a five-year veteran with the department. The other officer has worked for Hayward for more than 11 years, Koller said.

They both remained on administrative leave on Wednesday, a standard move after an officer-involved shooting.

Hayward police are investigating the incident along with the Alameda County District Attorney's Office.

Contact Natalie Neysa Alund at 510-293-2469. Follow her at Twitter.com/nataliealund.