TAMPA — A man trying to commit a home invasion robbery was hospitalized Tuesday night after being attacked by residents inside the house, police said.

The robbery was reported just before midnight at 10108 N. 10th St., shortly after Devon Evans, 26, knocked on the door and Jeffery Dennis answered.

According to police, Evans forced Dennis, 26, into a back room where Clifford Gray, 47, was sleeping.

Evans pointed a gun at Gray and ordered him to the floor. But that's when the other man — Dennis — grabbed Evans. The pair fought and the gun fired several times.

Gray was able to grab the gun, as well as a machete which he had in the room. He swung the machete, striking the suspect, Evans, several times, causing deep cuts, police say.

During this time, Gray accidentally hit Dennis above the knee with the machete.

Evans fell to the floor and was soon helped by paramedics.

Both he and Dennis were transported to area hospitals. Evans was in critical condition Wednesday.