The head of the Islamic State used to be a dignified scholar — who served as a university administrator and college professor in Iraq — before becoming the leader of one of the most deadly terrorist organizations in the world, a Pentagon official tells The Post.

Declassified military files revealed this week showed that Abu Bakr al-Baghdadi had worked as an administrative secretary before leading the Islamic State, but an interpreter had evidently botched the translation while interviewing him and accidentally listed the wrong occupation.

“He was more of an assistant dean,” said the official, who wished to not be named. “A front office administrator and professor at an undisclosed college in Iraq.”

The US Army documents showed that al-Baghdadi had been captured in the Iraqi city of Fallujah on Feb. 4, 2004 and held as a “civilian detainee” for just over 11 months.

“U.S. Coalition forces at the time received information that there were suspected insurgents in a home in al-Baghdadi’s hometown of Fallujah,” the official explained. “They captured him along with other suspected insurgents and they were brought to Camp Bucca for detainment.”

Since no weapons, explosives or bomb making materials were found, al-Baghdadi was held for nearly a year without being charged.

Housing 100,000 detainees in its barracks, Camp Bucca provided an unprecedented setting for prisoner radicalization, according to a Washington Post report.

“Many of us at Camp Bucca were concerned that instead of just holding detainees, we had created a pressure cooker for extremism,” former prison commander James Skylar Gerrond wrote on Twitter in July 2014.

In total, the terrorism research firm Soufan Group reports that nine members of the Islamic State’s top command had previously did time at Bucca.

Little had been known about the mysterious Islamic State leader before 2010, but the US Army records obtained this week give the public an inside look at the man behind the barbarism that has taken root in Iraq, Syria and Libya.

Al-Baghdadi was held at multiple facilities throughout his imprisonment, including Bucca and Camp Adder.