The term imposed on 29-year-old Amine El-Khalifi of Virginia was the highest allowed under a plea deal.
El-Khalifi admitted plotting with undercover agents he believed were from al-Qaida and volunteering to run a suicide operation at the Capitol, going so far as to wear what he thought was a bomb-laden vest.
El-Khalifi expressed no remorse at Friday's hearing and said only that he loves Allah.
Defense lawyers say the sting operation preyed on El-Khalifi's financial woes by giving him nearly $6,000.
Prosecutors say El-Khalifi came to authorities' attention in part by answering a Facebook post seeking to recruit Muslim holy warriors.