But the lights went back on less than an hour later, utility officials say.
Electricity was restored about half an hour later, but officials decided to keep the building evacuated until the cause of the outage was determined, said Bob Stevenson, a spokesman for Senate Majority Leader Bill Frist, R-Tenn.
Mary-Beth Hutchinson, a spokeswoman for Potomac Electric Power Co., said the electricity was shut off automatically after there was "a momentary drop in voltage due to customer operations up the lines" away from the Capitol.
"The protective equipment sensed the significant change in voltage and tripped," she said.
A Department of Homeland Security official said it was a "simple power outage" that affected only the Capitol and not any nearby office buildings, CBS News reports.
Before the evacuation sirens went off, more than 100 visitors sat in the darkened House gallery. They exited with everyone else when the alarm sounded, calmly walking toward exits.
A Pepco spokeswoman said power was restored to the building and the company was investigating the cause of the outage.
A Senate aide says the power system had recently been experiencing what he called low-level difficulties.
Sirens signaling the evacuation went off and lawmakers and visitors were told to leave.
It was not immediately clear what the cause of the outage was. Before the sirens went off, visitors calmly walked toward the exits and it appeared that emergency generators were activated because some lights flickered back on.
Security officers and other building personnel walked the halls of the Senate and House of Representatives with flashlights.