Oscar Ortega-Hernandez, 22, of Idaho, was charged with shooting at the White House on November 11, 2011 with a semi-automatic weapon. At least eight rounds hit the building and two bullets were recovered, US Attorney Ronald C Machen said in Washington, DC on Wednesday.
Neither United States President Barack Obama nor his family members were home at the time of the shooting and no one was injured.
Ortega-Hernandez, who had fired from his car south of the White House, was arrested five days later in Pennsylvania.
He faces a minimum of 10 years and up to 27 and a half years in jail. Sentencing is scheduled for January 10, 2014.
"Firing an assault rifle at the White House to make a political statement is terrorism, plain and simple," said the Attorney Machen.
"As we have seen this week, gunmen who come to the nation's capital bent on violence can inflict terrible damage. This act of cowardice put lives at risk. Today's plea demonstrates that those who come to the District of Columbia, planning to use violence to send a message, should expect to spend decades behind bars," he said.
According to court documents and federal prosecutors, on March 19, 2011, Ortega-Hernandez purchased a Romanian Cugir SA semi-automatic (AK-47-style) assault rifle from an individual in Idaho for $550.
He also purchased more than 1,200 rounds of ammunition to use with the weapon. In August 2011, he purchased a scope kit on the Internet and asked a friend to install it on the weapon for him.
Over the course of six months, Ortega-Hernandez repeatedly practiced firing the weapon at a desolate crater located on land owned by the Bureau of Land Management outside of Idaho Falls, Idaho.
On October 23, 2011, he made two short videos at the home of one of his friends. In the videos, he praised Osama bin Laden for having the courage to stand up to the United States, and called for a revolution against the federal government.
Ortega-Hernandez described himself as a "cold-hearted warrior of God" and declared, "it's time for Armageddon."
Photograph: Reuters
Brazilian president postpones US visit over spying claims
Indian-American, gunman, among 13 killed in US Navy Yard shooting
How Russia helped US with an exit strategy in Syria