LONG BEACH — A man accused of shooting a Long Beach code enforcement officer in the face and then holding police at bay for nearly seven hours pleaded not guilty Wednesday to attempted murder and other charges.

Anthony Glen Gorospe, 51, of Long Beach, was charged July 9 with one count each of attempted murder and possession of a firearm by a felon, three counts of attempted murder of a peace officer and five counts each of assault on a peace officer with a semiautomatic firearm and assault with a semiautomatic firearm.

He is accused of shooting the inspector around 8 a.m. July 5 at his home in the 6100 block of John Avenue. Officers evacuated some neighbors from the area as they tried to coax the man into surrendering. He was taken into custody in his yard around 2:40 p.m. after a police dog was sent in.

Long Beach police Chief Jim McDonnell said the suspect fired more shots during the standoff, but no other injuries were reported. A ballistic tactical vehicle was sent into the residence, along with several canisters of tear gas, but the suspect fired more shots and repeatedly yelled out for officers to shoot him, police said.

Neighbors said the man had lived in the home for years with his mother, who recently died.

McDonnell said code enforcement workers were trying to serve an inspection warrant at the home, which has been the subject of code violations for years.