US Marine Corps Maj. Gen. Stephen Neary is seen in this file photo.
CNN  — 

The commander of US Marines in Europe and Africa was relieved of command Monday amid allegations that he used a racial slur, according to a US defense official.

US Marine Corps Maj. Gen. Stephen Neary, the commander of Marine Corps Forces, Europe and Africa, was relieved by Gen. David H. Berger, the commandant of the Marine Corps, “due to a loss of trust and confidence in his ability to serve in command.” the Marine Corps said in a statement.

Neary has been under investigation due to an alleged use of a racial slur in front of Marines, an allegation that was first reported in Stars and Stripes.

Stars and Stripes reported that the incident occurred in August outside the Marine Corps Forces Europe and Africa headquarters in Boeblingen, Germany, and that Neary used the n-word in front of junior Marines after having heard the word used in rap lyrics that a group of Marines conducting physical training outdoors were listening to. The lyrics prompted Neary to ask the junior Marines how they would feel if he said it.

The defense official confirmed the details of the allegation to CNN and said that the investigation into the incident is still ongoing but that it had already yielded sufficient information to help prompt the decision to relieve Neary of command.

CNN has been unable to reach Neary directly but contacted his command who referred to the Marine Corps statement.

The Marine Corps said that Col. James T. Iulo will serve as the acting commander until a replacement is determined, helping to oversee the 1,500 Marines in Europe and Africa.

The US military has taken steps in recent months to address racism in the armed services, unveiling a series of initiatives aimed at addressing prejudice within the military.

Berger has been outspoken about the need to address racism within the Marines.