The man - identified as Jesse Olivieri from Ashland, Pennsylvania - has been admitted to a nearby hospital with critical injuries, officials said.
Eyewitnesses described him as around 5 feet, 10 inches tall with shaggy blonde hair.
The incident took place at around 3.06 PM (local time) when an "adult male subject, carrying a firearm, approached an outer perimeter checkpoint accessible to the general public" on E Street near the White House, the Secret Service said.
"When he failed to comply with the verbal commands, he was shot once by a Secret Service agent and taken into custody," said David A Iacovetti, Deputy Assistant Director Office of Government and Public Affairs, US Secret Service.
Also Read
"The Secret Service recovered a firearm at the scene."
President Barack Obama was not present on the premises as he had gone to play golf at Andrews Airforce Base.
However, Vice President Joe Biden was present in the complex and the Secret Service agents rushed to him for additional security.
Snipers took to the White House roof with guns drawn as people were cleared off the streets. Some people were heard screaming on Pennsylvania Avenue.
During a search of the man's vehicle parked near 17th Street and Constitution Avenue, federal agents found ammunition for a .22 caliber weapon.
Based on preliminary investigation, the Federal Bureau of Investigation (FBI) and other law enforcement agencies said the shooting incident has no known nexus to terrorism.
"However, an investigation continues into the motives behind his actions. The investigation is ongoing, and will continue to follow all logical leads," said the statement issued late in the night.
No law enforcement personnel and bystanders were injured.
The White House has seen a number of security incidents in recent years, prompting changes at the executive complex.
Just last month, a person was detained by secret service agents for allegedly throwing a backpack over the White House fence and then climbed over the barrier.