Federal prosecutors concluded an 18-month investigation into a former congressional technology staffer on Tuesday by publicly debunking allegations — promoted by conservative media and President Trump — suggesting he was a Pakistani operative who stole government secrets with cover from House Democrats.

As part of an agreement with prosecutors, Imran Awan pleaded guilty to a relatively minor offense unrelated to his work on Capitol Hill: making a false statement on a bank loan application. U.S. prosecutors said they would not recommend jail time.

The plea agreement included an unusual passage that described the scope of the investigation and cleared Awan of a litany of conspiracy theories promulgated on Internet blogs, picked up by right-leaning news sites, and fanned by President Trump on Twitter.

“The Government has uncovered no evidence that your client violated federal law with respect to the House computer systems,” including stealing equipment or illegally accessing or transferring information, prosecutors wrote in the plea agreement dated and signed Tuesday.

Federal prosecutors described in the agreement a “thorough investigation” that included forensic analysis of computer equipment and other devices, log-on and usage data and interviews with about 40 witnesses.

Awan and four of his associates, including family members, worked as IT specialists for dozens of Democratic lawmakers until they were banned from the computer network in February 2017 for allegedly violating House security rules.

The ensuing investigation attracted aggressive coverage by conservative media outlets — led by The Daily Caller — and prompted calls from Trump to prosecute Awan, whom the president referred to in one tweet as the “Pakistani mystery man.”

The case has highlighted Trump’s willingness to lobby for specific outcomes of federal criminal investigations and to suggest a cover-up by his own Department of Justice. Trump also attempted to tie Awan to the hacking of the Democratic National Committee server — a breach that intelligence agencies have concluded was directed by Russia.

“Our Justice Department must not let Awan & Debbie Wasserman Schultz off the hook,” he tweeted last month, after a court filing indicated prosecutors were in plea negotiations. “The Democrat I.T. scandal is a key to much of the corruption we see today. They want to make a ‘plea deal’ to hide what is on their Server. Where is Server? Really bad!”

Prosecutors with the U.S. Attorney’s Office of the District of Columbia did not mention Trump or any media publications by name in the agreement.

But the agreement included an exhaustive list of “public allegations” that prosecutors investigated and shot down.

“Particularly, the Government has found no evidence that your client illegally removed House data from the House network or from House Members’ offices, stole the House Democratic Caucus Server, stole or destroyed House information technology equipment, or improperly accessed or transferred government information, including classified or sensitive information.”

The office that conducted the investigation is led by Trump-nominated U.S. Attorney Jessie K. Liu. Awan was released from electronic monitoring and will be free pending his sentencing Aug. 21 U.S. District Judge Tanya S. Chutkan ordered in the Tuesday hearing.

As part of the deal, prosecutors agreed to drop a bank fraud charge against Awan’s wife Hina Alvi. Awan agreed to plead guilty to a felony related to an application for a home equity line of credit. He told a bank that the home was his wife’s primary residence; it was a rental property. The loan was fully re-paid.

Awan and his associates were each assigned to work for individual lawmakers, but they shared job duties and login information for multiple servers, a practice that is prohibited under House rules. Gowen said that and other security concerns that led to the loss of Awan’s access to the House network illustrated a culture of “disorganization” in Congress rather than espionage.

In his first public statements since the investigation began, Awan told The Post in an interview prior to Tuesday’s hearing that he questions whether the case would have been pursued if he did not have a Pakistani name. He said he came to the United States as a teenager, put himself through college, became a U.S. citizen, and built a career on Capitol Hill — what he portrayed as the fulfillment of a dream.