WASHINGTON (Reuters) - The Pentagon has failed what is being called its first-ever comprehensive audit, a senior official said on Thursday, finding U.S. Defense Department accounting discrepancies that could take years to resolve.

The Pentagon in Washington, U.S., is seen from aboard Air Force One, March 29, 2018. REUTERS/Yuri Gripas - RC125AF3E6D0

Results of the inspection - conducted by some 1,200 auditors and examining financial accounting on a wide range of spending including on weapons systems, military personnel and property - were expected to be completed later in the day.

“We failed the audit, but we never expected to pass it,” Deputy Secretary of Defense Patrick Shanahan told reporters, adding that the findings showed the need for greater discipline in financial matters within the Pentagon.

“It was an audit on a $2.7 trillion dollar organization, so the fact that we did the audit is substantial,” Shanahan added.

The U.S. defense budget for the 2018 fiscal year that ended on Sept. 30 was about $700 billion. The Pentagon is a huge agency with multiple branches of the military, costly weapons systems, large personnel needs, numerous military bases of various sizes at home and abroad and troops deployed in far-flung locales.

Shanahan said areas the Pentagon must improve upon based on the audit results include compliance with cybersecurity policies and improving inventory accuracy. In a briefing with reporters, he did not provide a figure detailing how much money was unaccounted for in the audit.

It was unclear what consequences there would be after the audit, but Shanahan said the focus would be on fixing the issues.

“We need to develop our plans to address the findings and actually put corrective actions in place,” Shanahan said.

“Some of the compliance issues are irritating to me. ... The point of the audit is to drive better discipline in our compliance with our management systems and procedures,” Shanahan added.

A 1990 federal law mandated that U.S. government agencies be audited, but the Pentagon had not faced a comprehensive audit until this one was launched in December.

Defense officials and outside experts have said it may be years before the Pentagon is able to fix its accounting gaps and errors and pass an audit.

“To clarify, the audit is not a ‘pass-fail’ process. We did not receive an ‘adverse’ finding - the lowest possible category - in any area,” U.S. Army Lieutenant Colonel Joseph Buccino, a Pentagon spokesman, said in an email.

“We did receive findings of ‘disclaimer’ in multiple areas. Clearly more work lies ahead of us,” Buccino added.