A Maryland state trooper shot an attacking pit bull dog last week when she could not close a door on it because of a man lying unconscious in the doorway, the state police said.

Earlier in the month, another trooper killed a pit bull in Cecil County.

Last week’s incident occurred Wednesday in the Mechanicsville area of St. Mary’s County, after the trooper was sent to a house where a man was reported not to be breathing, the police said.

As the trooper entered the house in the 47000 block of King Drive, the large pit bull charged and tried to bite.

She struck it with her baton, and it retreated outside the house, police said. However, the position of the unconscious man prevented her from closing the door, and the dog attacked again. It pulled her baton away, then dropped it and lunged at the trooper, biting her right foot.

Fearing for her safety, police said, the trooper fired, and the wounded dog fled.

Police said they were told by witnesses that the dog had bitten others in the past. Full details were not immediately available.