The US military has dismissed two high-ranking officers – one of whom was found to be having an extramarital affair, it was learned on Friday.

Brig. Gen. Michael Bobeck, an Army National Guard general on the Joint Chiefs of Staff, was fired after an internal investigation found that he had been having an affair, according to USA Today.

Engaging in an extramarital affair is a violation of military rules.

Bobeck was also found to have lived rent-free in an apartment owned by an executive from a company that has links to arms contractors who conduct business with the Department of Defense.

Brig. Gen. Michael Bobeck, an Army National Guard general on the Joint Chiefs of Staff (left) and Army Maj. Gen. Wayne Grigsby (right) were dismissed from their jobs

The company, Peduzzi Associates, is a consulting firm based in Alexandria, Virginia. Its aviation division supports defense firms that have business ties to the Pentagon.

Peduzzi is known to be a lobbyist for Sikorsky, a division of Lockheed Martin, one of the world’s largest manufacturers of military equipment.

The executive, Joe Ferreira, is said to have allowed Bobeck to stay in the basement of his apartment. The two men are also said to have discussed a possible job for Bobeck, according to USA Today.

The military and the US government are vigilant in enforcing rules that would prohibit any relationship between actively serving military members and defense contractors since such ties could breed conflicts of interest.

A Department of Defense (above) review found that Bobeck was having an extramarital affair and was living rent-free in the home of a businessman linked with defense contractors

Bobeck’s attorney, Lt. Col. Adam Kazin, denied that there was anything untoward as it relates to Bobeck’s living arrangement.

“Any implication that there was any wrongdoing is very upsetting to him,” Kazin said.

“Abusing his position to enrich himself is not in line with how he views himself.”

Ferreira told USA Today that he has known Bobeck for 35 years and that their friendship was the reason that he agreed to allow the general to stay in his apartment.

Bobeck had just recently divorced his wife, Ferreira said. Allowing him to stay in his home was an act of friendship that had nothing to do with business, he maintained.

Bobeck has been reassigned within the military pending the investigation.

Last month, Maj. Gen. David Haight was fired after it was learned he had been having an affair and was living a 'swinger lifestyle'

Meanwhile, the Army also announced on Friday that Maj. Gen. Wayne Grigsby, the commander of the 1st Infantry Division at Fort Riley, Kansas, was dismissed, according to USA Today.

The military, however, did not specify the reason for the dismissal.

Last month, US Army Maj. Gen. David Haight was fired after leading a decade-long double life including an affair and a 'swinger lifestyle' with multiple partners and sex parties, leaving him at risk of blackmail.

Haight was investigated earlier this year and fired in May from his senior position at US European Command, a position in charge of the United States military's attempts to confront Russia's aggression in Eastern Europe.