The breach will come as an embarrassment to the government as security has supposedly been tightened in recent years in response to the terrorist threat and past incursions.
Gordon Brown today condemned the activists, telling MPs during his weekly question time session: "Decisions should be made in this house and not on the roof of this house, and that is a very important message to send out to protesters."
The five activists, from the campaign group Plane Stupid, had unfurled two huge banners, one saying "No third runway", and the other, "BAA HQ", in a reference to the airport's operator.
The demonstrators ended their protest shortly after midday, descending from the roof. A police spokeswoman said they had all been detained and would be arrested.
Earlier police said there was a "strong possibility" the protesters had been the guests of parliamentary passholders.
Westminster sources said they suspected the banners were stored inside the Commons for the group to collect, as they were too big to have been taken through security. But Plane Stupid insisted the campaigners took them in.
"I know we have exposed a huge security flaw up here but our message is the same [as the Heathrow airport protest on Monday]," Richard George told guardian.co.uk from the roof. "It's not as big as the flaw in the government's climate change policy."
The 27-year old claimed the Plane Stupid group walked into the Houses of Parliament through the main St Stephen's entrance as visitors attending a debate on the occupied territories at 9.30am. He said their banners were undetected by armed police officers and despite airport-level security.
"We said we were watching a committee and got a lift up to one of the committee corridors and then walked through a fire escape on to the roof," he said. "We then walked across a walkway to the front of the building."
He said Plane Stupid, whose previous stunts include rushing the stage at aviation conferences, had staged the protest to highlight "collusion between the government and BAA" over a consultation on Heathrow expansion - including a proposal for a third runway - that ends today.
The other protesters were a Greenpeace employee, Graham Thompson, 34; Leo Murray, 31, an animation student at the Royal College of Art; Olivia Chessel, 20, a youth worker; and Tamsin Omond, 23, an English literature graduate at Cambridge University and volunteer church worker.
The protesters chained themselves to a stairwell on the roof. Police quickly moved in and cut through the chains but still faced a battle to remove them safely.
The rooftop protest came just two days after Greenpeace activists protesting against the third runway staged a demonstration on top of a British Airways jet at Heathrow.
Matthew Knowles, spokesman for the Society of British Aerospace Companies, said the stunts were "becoming tiresome" and "peddle inaccurate propaganda".
"Heathrow's expansion is of national importance if jobs are to be safeguarded and created both locally as well as in the City and across the country," he said.
In 2005 the government passed legislation banning protests within 1km of Parliament Square to remove the anti-war protester Brian Haw from the square, although it also cited security concerns.
The threat posed by terrorists has seen a number of other security measures introduced, including concrete blocks placed around the Houses of Parliament.
© 2008 The Guardian