A man was shot and killed by a deputy outside of UNC Health Johnston in Clayton early Monday morning during a struggle that began when the man tried to take the deputy's gun, authorities said.

The altercation happened on the hospital’s campus, according to a statement from UNC Health Director of News and Media Relations Alan Wolf, prompting a response from deputies with the Johnston County Sheriff’s Office.

The deputy tried to leave the lot in his patrol car about 5:45 a.m. when the man confronted him and attempted to take his firearm, the Johnston sheriff's office said in a new release. The deputy was able to regain control of his weapon, and shots were fired that resulted in the suspect's death, the release said.

"We are thankful that no hospital employees or patients were harmed and appreciate the rapid response by law enforcement. All areas of the hospital are open," UNC Health Johnston Public Relations Specialist Suzette Rodriguez said.

The name of the deputy and the man were not immediately released. The State Bureau of Investigation was asked to review what happened, which is common in such officer-involved shootings. 

Hospital security staff were escorting visitors and patients on the campus Monday morning before the hospital returned to normal operations, a hospital spokesperson said. The hospital opened in 2009 with emergency and outpatient services and now includes 50 patient rooms for in-patient care.

The deputy has been placed on administrative leave with pay, news outlets said.