WASHINGTON — Confined to the basement of a CIA secret prison in Romania about a decade ago, Khalid Sheikh Mohammed, the admitted mastermind of the 9/11 terrorist attacks, asked his jailers whether he could embark on an unusual project: Would the spy agency allow Mohammed, who had earned his bachelor’s in mechanical engineering, to design a vacuum cleaner?

The agency officer in charge of the prison called CIA headquarters and a manager approved the request, a former senior CIA official told The Associated Press.

Mohammed had endured the most brutal of the CIA’s harsh interrogation methods and had confessed to a career of atrocities. But the agency had no long-term plan for him. Someday, he might prove useful. Perhaps, he’d even stand trial one day.

And for that, he’d need to be sane.

“We didn’t want them to go nuts,” the former senior CIA official said, one of several who spoke on condition of anonymity because they were not authorized to talk about the now-shuttered CIA prisons or Mohammed’s interest in vacuums.

So, using schematics from the Internet as his guide, Mohammed began re-engineering one of the most mundane of household appliances.

That the CIA may be in possession of the world’s most highly classified vacuum cleaner blueprints is but one peculiar, lasting byproduct of the controversial U.S. detention and interrogation program.

By the CIA’s own account, the program’s methods were “designed to psychologically ‘dislocate'” people. But once interrogations stopped, the agency had to try to undo the psychological damage inflicted on the detainees.

The CIA apparently succeeded in keeping Mohammed sane. He appears to be in good health, according to military records.

Others haven’t fared as well. Accused al Qaeda terrorists Ramzi Binalshibh and Abd al-Nashiri, who were also locked up in Poland and Romania with Mohammed, have had mental issues. Al-Nashiri suffers from depression and post-traumatic stress disorder. Binalshibh is being treated for schizophrenia with a slew of anti-psychotic medications.

“Any type of prolonged isolation in custody — much less the settings described in the press — have been known to have a severe impact on the mental condition of the detainee,” said Thomas Durkin, Binalshibh’s former civilian lawyer. Durkin declined to discuss Binalshibh’s case.

Mohammed was subjected to harsh interrogations in Poland. Agency officers and contractors forced him to stay awake for 180 hours, according to a CIA inspector general’s report. He also underwent 183 instances of waterboarding, or simulated drowning.

After the CIA prison in Poland was closed in September 2003, Mohammed was moved to Bucharest, to a black site code-named “Britelite.” Soon the CIA was trying to find ways to entertain Mohammed as his intelligence value diminished.

The prison had a debriefing room, where Mohammed, who saw himself as something of a professor, held “office hours,” as he told CIA officers. While chained to the floor, Mohammed would lecture the CIA officers on his path to jihad, his childhood and family. Tea and cookies were served.

Along with the other five detainees at the prison in Bucharest, Mohammed was given assignments about his knowledge of al Qaeda, or “homework,” as CIA officers called it. He was given Snickers candy bars as rewards for his studiousness.

In Romania, the prison provided books for detainees to read. Mohammed, former officials said, enjoyed the Harry Potter series. For the CIA officers at the prison, not so much. For security reasons, after a prisoner finished a book, they tediously checked every page to ensure detainees weren’t passing messages. They once caught Mohammed trying to hide a message in a book warning his prison mates not to talk about Osama bin Laden’s courier.

Mohammed graduated from North Carolina A&T State University with a degree in mechanical engineering in 1986. It’s not clear whether Mohammed was interested in designing a better vacuum or had ulterior motives. He might have intended to use the plans to conceal secret information or trick his jailers.

In Graham Greene’s spy thriller “Our Man in Havana,” a vacuum salesman in Cuba agrees to work for MI6, the British spy service. He dupes the British into believing his vacuum designs are military installations. The AP was unable to determine whether Mohammed ever read the famous novel.

It remains a mystery how far Mohammed got with his designs or whether the plans still exist. The secret CIA prison in Romania was shuttered in early 2006 and Mohammed was transferred later that year to Guantanamo Bay Naval Base prison, where he remains. It’s unlikely he was able to take his appliance plans to Cuba.

Mohammed’s military lawyer, Jason Wright, said he was prohibited from discussing his client’s interest in vacuums.

“It sounds ridiculous, but answering this question, or confirming or denying the very existence of a vacuum cleaner design, a Swiffer design, or even a design for a better hand towel would apparently expose the U.S. government and its citizens to exceptionally grave danger,” Wright said.

But Wright added that he often discussed “modern technological innovations” and the “scientific wonders” of the Quran with Mohammed. He called Mohammed “exceptionally intelligent.”

“If he had access to educational programs in Guantanamo Bay, such as distance learning programs, I am confident that in addition to furthering his Islamic studies, he could obtain a Ph.D. in mechanical engineering, and very likely patent inventions,” Wright said.

The CIA won’t discuss the Mohammed’s vacuum plans, either. The AP asked the CIA for copies of the vacuum designs or any government records about them under the Freedom of Information Act.

The CIA responded in a letter to the AP that the records, “should they exist,” would be considered operational files of the CIA — among its most highly classified category of government files — and therefore exempt from ever being released to the public.