Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

The military was mourning two soldiers Tuesday who were fatally shot while trying to protect a woman from a gun-toting man in a South Carolina bar.

Staff Sgt. Charles Allen Judge Jr., 40, and Sgt. First Class Jonathan Michael Prins, 29, “were acting as good Samaritans when they were shot,” said Capt. Adam Myrick of the Lexington County Sheriff’s Department.

Joseph Elijah Mills, 25, is charged with two counts of murder in Lexington County, South Carolina. Lexington County Sheriff's Office

And they paid for their bravery with their lives.

"We are shocked and saddened by the loss of Staff Sgt. Judge," said his commanding officer at the McCrady Training Center, Col. Renita Berry. "He was an outstanding instructor who served with great dedication and enthusiasm and demonstrated unwavering commitment to his peers, his students and this organization every day. He will be missed tremendously.”

U.S. Army Brig. Gen. Van McCarty said he served with Judge in Iraq in 2004 and called him a “soldier’s soldier.”

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Prins was a drill sergeant at Fort Jackson who had served in Afghanistan and in Iraq.

"The way SFC Prins was taken from us, is a testament to his bravery and his selfless service," fellow Fort Jackson drill sergeant Brandonn Baldwin posted.

Joseph Elijah Mills, 25, was arrested shortly after Sunday’s double killing and charged with two counts of murder.

“I’m very sorry about what happened,” Mills said at his arraignment Monday, The State newspaper reported. “I never meant for it to happen like that. I was being lynched by eight people because I was chasing a girl who grabbed drugs off the seat and took off running.”

Sgt. First Class Jonathan Michael Prins, 29, was fatally shot while trying to protect a woman in a South Carolina bar. SFC Jonathon Prins' GoFund Me

Judge and Prins were at the Frayed Knot Bar & Grill in Lake Murray, west of Columbia, when Mills “physically assaulted a female companion and was physically separated from her by several bar patrons,” according to arrest warrants obtained by NBC News.

Among those who stepped in to help the woman were Judge and Prins, the warrants state.

“Mills then presented a handgun” and allegedly fired the fatal shots.

Judge was hit twice and Prins three times, according to the Lexington County Coroner’s Office.

Mills, who lives in Little Mountain, north of Lake Murray, was arrested a short time later.

The warrants did not identify the woman Mills allegedly slammed into a railing or divulge her condition.

Judge was the father of a son and daughter, Lt. Col. Cindi King, a spokeswoman for the South Carolina National Guard, told NBC News.

Prins was married with three children ages 3 to 9, The State newspaper reported.