A standoff lasted for several hours before police cleared the scene.
CHARLOTTE, N.C. -- An attempt to serve a warrant turned deadly Monday when a deputy U.S. marshal and three other members of a task force were shot and killed in Charlotte.
In all, eight law enforcement officials were shot, including two correction officers who were killed and a Charlotte-Mecklenburg police officer who was critically wounded and later died. Three other Charlotte-Mecklenburg officers were also shot.
Charlotte-Mecklenburg Police Department (CMPD) Chief Johnny Jennings said at a 9:40 p.m. briefing that Officer Joshua Eyer had succumbed to his injuries.
"Officer Joshua Eyer has passed away tonight from his injuries after being shot in the line of duty this afternoon while assisting other officers with the apprehension of a suspect," CMPD said in a statement on social media. "Officer Eyer faithfully served the CMPD's North Tryon Division for six years and was a member of the 178th Recruit Class. We are forever indebted to Officer Eyer for his bravery and ultimate sacrifice. His life and service will never be forgotten. Please say a prayer for Officer Eyer's loved ones during this difficult time."
Eyer was survived by his wife and a 3-year-old son, Jennings said.
He added that "we're still actively investigating this and that this incident would "still be a CMPD case."
WATCH: Charlotte-Mecklenburg Police chief gives update on fallen officer
The deadly saga began around 1:30 p.m. when the U.S. Marshals Task Force went to serve a warrant on a convicted felon believed to have illegal firearms in the 5000 block of Galway Drive in the North Tryon Division.
As officers approached the suspect, the man opened fire, striking multiple officers. As officers returned fire, more shots struck additional officers.
The man shooting at the officers left the home and was killed in the front yard of the home in the eastern Charlotte neighborhood.
The CMPD's Special Weapons and Tactics Team (SWAT) then began negotiations with other occupants in the house. A standoff began and lasted for several hours. That included armored vehicles crashing into the suburban home in a tree-lined neighborhood and tearing off doorways and windows.
Two women came out and were taken to the Law Enforcement Center to be interviewed by detectives.
The armed suspect who was killed by officers was identified late Monday night as Terry Clark Hughes Jr, 39.
Hughes was wanted for possession of a firearm by felon and two counts of felony flee to elude out of Lincoln County, North Carolina.
"Today we lost some heroes who were out simply trying to keep our community safe," Jennings said.
During a 6 p.m. news conference, Charlotte-Mecklenburg Police said three U.S. marshals had been killed, and a fourth injured.
Later, the U.S. Marshals Service confirmed that one of its officers had been killed. North Carolina Gov. Roy Cooper clarified that the other two killed were officers with the State Department of Adult Correction who were working with the task force.
Todd Ishee, NC Secretary of Adult Correction, identified the two officers killed as Sam Poloche and Alden Elliott, both 14-year NC Department of Adult Correction veterans.
Poloche leaves behind a wife and two children, and Elliott and his wife were parents to one child, Ishee said.
"Every single day, Deputy U.S. Marshals and Task Force Officers put their lives on the line to apprehend some of our country's most dangerous criminals," Attorney General Merrick B. Garland said in a statement. "Today, three of those dedicated public servants made the ultimate sacrifice. Multiple other officers were critically injured while carrying out this operation to protect their community. The Justice Department is heartbroken by the deaths of three of our own law enforcement colleagues, and we extend our deepest condolences to their loved ones as they grieve this unfathomable loss."
WATCH: Full 6 p.m. news conference
Cooper posted on social media that he had offered state resources to assist local law enforcement in any way they may need.
Cooper later arrived in Charlotte, the state's largest city, to meet with officials and the families of the victims.
Charlotte Mayor Vi Lyles took to social media to offer her thoughts on the shooting:
"I am deeply saddened by the shooting that occurred that involved Charlotte-Mecklenburg police officers and US Marshals today. I ask that all Charlotteans keep them, the other injured officers, and their families in your thoughts and prayers during this incredibly difficult time."
President Joe Biden was briefed on the shooting and spoke to Cooper to express his condolences and support for the community, according to the White House.
In a statement, the White House said: "The president was briefed on the shooting in North Carolina, in which multiple law enforcement officers were killed. He spoke to Governor Cooper and expressed his condolences and support for the community. In addition, senior White House officials are in touch with federal, state, and local officials."
Biden later issued a more detailed statement:
"Earlier today, four brave law enforcement officers - including a Deputy U.S. Marshal - were killed in the line of duty. They are heroes who made the ultimate sacrifice, rushing into harm's way to protect us. We mourn for them and their loved ones. And we pray for the recoveries of the courageous officers who were wounded.
When a law enforcement officer puts on that shield in the morning and heads out the door, their family members dread the phone call - the very call that came today. It's like losing a piece of your soul. To the families of those we lost: Jill and I, and all Americans, are here for you. And we will always be here for you.
We must do more to protect our law enforcement officers. That means funding them - so they have the resources they need to do their jobs and keep us safe. And it means taking additional action to combat the scourge of gun violence. Now. Leaders in Congress need to step up so that we ban assault weapons and high-capacity magazines, require safe storage of guns, and pass universal background checks and a national red flag law. Enough is enough.
May God Bless these fallen heroes."
The last marshal shot and killed in the line of duty was in November 2018. Chase White was shot in Tucson, Arizona, by a man wanted for stalking local law enforcement officers, the agency said.
The investigation is being conducted by CMPD's Homicide Unit. As is standard procedure with any officer-involved shooting, the CMPD's Internal Affairs Bureau is conducting a separate but parallel investigation.
ABC11's Sydnee Scofield and The Associated Press contributed.