The term imposed on 29-year-old Amine El-Khalifi of Alexandria 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 don what he thought was a bomb-laden vest.
At Friday's hearing, El-Khalifi expressed no remorse 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.