In the days following the Sept. 11 terrorist attacks, alleged al-Qaida operations mastermind Khalid Sheik Mohammed intended to use his free Hotmail account to direct a U.S.-based operative to carry out an attack, according to a guilty plea agreement filed by Al Saleh Kahlah al-Marri in federal court.

The document shows how al-Qaida, at least in 2001, embraced prosaic technologies like pre-paid calling cards, public phones, computer search engines and simplistic codes to communicate, plan and carry out its operations.

Al-Marri also surfed the Internet to research cyanide gas, using software to cover his tracks, according to the document filed Thursday in federal court in Peoria, Ill. He marked the locations of dams, waterways and tunnels in the United States in an almanac. The government claims this reflects intelligence that al-Qaida was planning to use cyanide gas to attack those sites.

As a result of his guilty plea, al-Marri could be sentenced up to a maximum 15-year term in federal prison.

In a stipulation of facts filed as part of the plea agreement, al-Marri admitted that he trained in al-Qaida camps and stayed in terrorist safe houses in Pakistan between 1998 and 2001. There, he learned how to handle weapons and how to communicate by phone and e-mail using a code.

After arriving in the U.S. on Sept. 10, 2001 — a day before al-Qaida's long-plotted terror strikes in New York and Washington — Al-Marri stored phone numbers of al-Qaida associates in a personal electronic device.

He used a "10-code" to protect the numbers — subtracting the actual digits in the phone numbers from 10 to arrive at a coded number, according to a person close to the investigation.

In a 10-code, eight becomes a two, for example. Other al-Qaida members used the same code, according to the plea agreement.

Al-Marri sent e-mails to Khalid Sheik Mohammed's hotmail account — HOR70@hotmail.com — addressed to "Muk" and signed "Abdo." The details of that code were included in an address book found in an al-Qaida safehouse in Pakistan.

An attempt by The Associated Press to reach that address did not indicate the account had been closed, but it went unanswered.

Al-Marri initially tried to use a Yahoo e-mail account to contact Mohammed, but it failed to go through. So he switched to Hotmail as well. When al-Marri arrived in the United States, he created five new e-mail accounts to communicate with Mohammed, using the 10-code to send him his cell phone number in Peoria.

From September to November, al-Marri tried and failed to contact members of al-Qaida in Pakistan using prepaid calling cards and public phones, sometimes traveling 160 miles to use a different phone.

Al-Marri was arrested in December 2001, three months after entering the U.S. on a student visa. He was shortly thereafter declared an "enemy combatant" and taken into military custody.

The "enemy combatant" designation was dropped when he was indicted by a federal grand jury in Illinois.

Suspected as an al-Qaida sleeper agent, he was held without charge for more than five years. His attorneys say he was tortured there. There is no indication in the plea agreement that al-Marri ever made contact with other alleged al-Qaida agents inside the United States.

Al-Marri admitted that before entering the U.S., he met and had regular contact with Khalid Sheik Mohammed and with Mustafa Ahmad al-Hawsawi, who allegedly helped the Sept. 11 hijackers with money and Western-style clothing.