As a paid member of the Iraqi army, Mazin should be helping his country fight ISIS. Instead, the father-of-three is battling traffic as a taxi driver in Baghdad.

Mazin is one of the 50,000 "ghost soldiers" who pay a portion of their monthly military salary to superior officers in exchange for not having to turn up for duty. Iraqi Prime Minister Haidar al-Abadi has vowed to put an end to the scam — which has weakened his U.S.-trained army in the face of an ISIS insurgency.

"The reason behind doing this is that I have a family I need to take care of and two kids in school," Mazin, 38, told NBC News. "Besides, I have to pay for rent and other expenses. I found that this is the only way to earn more money, besides securing my future when I retire."

The U.S. spent billions of dollars on attempting to bolster Iraq's military before officially pulling out of the country in 2011. It was forced to send advisers back there this year after ISIS extremists overran huge areas of Iraq and neighboring Syria.

The prevalence of "ghost soldiers" — or "spacemen soldiers," as they are sometimes known within the ranks — was revealed by Abadi's spokesman earlier this month. The practice is considered to be one of the key reason Iraq's U.S.-trained military has proven ineffective in the face of ISIS, particularly in the city of Mosul where the militants are in control.

"Those 50,000 soldiers were revealed after an intense search through military documents and there will be a field search in order to put an end to this phenomenon and any other form of corruption," Abadi's spokesman Rafid Jaburi pledged.

"No one dared to talk about it"

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

That could prove difficult, given how long the scams have been going on — and how deeply ingrained the practice is.

"Most of those ghost elements of the Ministry of Interior are sons, relatives, guards of senior officers," a Baghdad police captain said.

Mazin said he struck a deal with a superior officer in 2009 to fork over half his monthly earnings — 1,100,000 Iraqi dinars, equivalent to about $950.

"The officer used to call me every month to receive my salary and give him his share,” he said. “He used to call me whenever we needed, for example, to renew our identification cards."

In exchange, Mazin was able to supplement his half-wage by driving a Baghdad taxi, which he said earns him 40,000 Iraqi dinars per day (about $33). Other perks, he said, were not having to "wake up early to go to my unit" and being able to retire after 10 years.

A senior source in the Iraqi Ministry of Defense acknowledged that "ghost soldiers" are nothing new to those in the military.

"We as officers, as well as normal soldiers, all knew that the army was filled with what we call 'spacemen soldiers,' but no one dared to talk about it," the source told NBC News on condition of anonymity. He said that officers often divide their share and pass it up the chain to a senior level.

Still, there are signs that the "ghost" days of Mazin and his peers could be numbered — Abadi has vowed to rid the military of no-shows and sacked dozens of officials since taking office.

Plus, new regulations have been put in place requiring several officers in different units to sign off on paychecks, according to the senior source in the Ministry of Defense.

For Mazin, it's unclear how long it'll be before he has to give up the "ghost."

"I do not know what’s going to happen next," Mazin said. "I talked over the phone to my officer. He told me that he thinks I will have to go back to normal service, but he does not know when."

Reuters contributed to this report.