A sheriff’s deputy investigating a domestic dispute on Maryland’s Eastern Shore was critically wounded and a man was killed when the two exchanged gunfire inside a house early Thursday, according to authorities.

The deputy was identified as Warren Scott Hogan, 32, a four-year veteran of the Queen Anne’s County Sheriff’s Office. He was recovering at the Maryland Shock Trauma Center in Baltimore from a close-range shotgun blast to his midsection, just below his bullet-resistant vest.

The man Hogan shot was identified by authorities as James Rich Jr., 52, who lived at the house on Edmore Road in Chester Harbor, near Chestertown, where the disturbance occurred. He was pronounced dead at University of Maryland Shore Medical Center.

Gregory M. Shipley, a spokesman for the Maryland State Police, said the incident began about 9:30 p.m. Wednesday when Rich’s live-in girlfriend sent a text message to her father indicating that the couple had been involved in a physical altercation.

The father called 911, and sheriff’s deputies went to the home but found no one there. Shipley said that Rich had left and that the woman had been picked up by her father and driven to a police station. At the station, Shipley said, the woman filled out a complaint and asked deputies to accompany her while she retrieved clothing from the house.

Sheriff’s Deputy Warren Scott Hogan (Queen Anne's County Sheriff's Office)

The woman, her parents and deputies returned to the house shortly after midnight. Shipley said Rich and his teenage son were, by then, home.

While inside, Shipley said, the woman and Rich “again became engaged in a verbal altercation. The suspect went into a back room and obtained a shotgun. He came out of the room and fired a round. He continued to walk toward Hogan, and in close proximity, they exchanged gunfire.” He said the deputy was armed with his department-issued Smith & Wesson .45-caliber handgun.

Shipley said that Hogan was wearing a body camera and that the video would be reviewed as part of the investigation.

The spokesman said deputies had visited the house before to serve a protective order and a peace order in July 2015. He said the orders involved Rich; he did not know whether they also involved his current girlfriend.

Thomas M. Scalea, physician in chief of the Maryland Shock Trauma Center, said Hogan underwent one surgery early Thursday but has many more to go. “He was awake and talking but clearly critically injured,” Scalea said. “He is still quite ill, but we are hopeful. It’s a little early to tell what else we’re going to have to do. We’ll see how things go for the next few days and few weeks.”

Scalea said Hogan suffered “a devastating injury” from the close-range blast. Shotguns fire pellets that spread out from the barrel of the gun. The doctor described a wound about the size of a softball. “There’s a huge amount of energy and a spreading zone of injury,” Scalea said.

Lt. Dale Patrick, a spokesman for the Queen Anne’s County Sheriff’s Office, said that Hogan is married and that before joining the department, he had worked for the Maryland Transportation Authority Police patrolling the Bay Bridge and the Baltimore-Washington International Marshall Airport.

Gary Hofmann, the sheriff, said Hogan’s family is “having a really tough time” with the incident, “as is the law enforcement community and the community of Queen Anne’s County.”