About 100 government supporters burst into Venezuela’s opposition-controlled National Assembly, where they beat up several lawmakers.
Witnesses said the confrontation came after an assembly session to mark the country’s Independence Day.
Military police guarding the site stood by as intruders brandishing sticks and pipes broke through the gate, AFP said.
The government promised an investigation to “establish the whole truth”, and punishment for the guilty.
Venezuela has been shaken by often violent protests in recent months and is in economic crisis.
The speaker of the assembly, Julio Borges, named on Twitter five of the lawmakers injured. Some were taken away for medical treatment.
“This does not hurt as much as seeing every day how we are losing our country,” deputy Armando Armas told reporters as he got into an ambulance, his head swathed in bloody bandages.
What is behind the crisis in Venezuela?
Witnesses said several journalists and two assembly staff were also hurt.
Venezuelan newspaper Tal Cual blamed the attack on militias known as “colectivos”, and said the group fired rockets and bangers as they forced their way in.
Its report said some of the deputies attacked “fell to the ground and were kicked”.
Photos and videos circulating on social media showed victims of the assault with bleeding head wounds. At least one, believed to be deputy Americo De Grazia, was carried out on a stretcher.
AFP, whose journalists were at the scene, said reporters were ordered to leave by the attackers, one of whom had a gun.
The violence unfolded while President Nicolás Maduro was giving a speech at a government-planned Independence Day military parade elsewhere in the capital.
Before the intruders rushed the building, Vice-President Tareck El Aissami made an impromptu appearance in the congress with the head of the armed forces, Vladimir Padrino Lopez, and ministers.
Mr El Aissami gave a speech urging the president’s supporters to come to the legislature to show support for him.
A crowd had been rallying outside the building for several hours before breaking into the grounds.
In a statement via the ministry of communication, the government said it “condemns the alleged acts of violence in the gardens of the Federal Legislative Palace”.
“The national government has ordered the investigation of the aforementioned acts of violence to establish the whole truth, and on that basis, to apply sanctions to those responsible,” it said.
What’s happening in Venezuela?
The country is in a deep economic crisis, made worse by the falling price of oil, which accounts for about 95% of its export revenues and was used to finance some of the government’s generous social programmes. Forced to make cuts, Mr Maduro has seen his support fall among core backers
Also, as a result of the crisis, parts of Venezuela face severe shortages of basic supplies such as medicine and food
The opposition accuses Mr Maduro of not only mismanaging the economy but also eroding the country’s democratic institutions
In March, the Supreme Court decided it would take over the National Assembly. The decision was reversed, but Mr Maduro was accused by opponents of trying to stage a coup. That sparked almost daily protests calling for his resignation
Meanwhile, Mr Maduro says the opposition is trying to overthrow his government illegally, and blames the country’s problems on an “economic war” being waged against him
Venezuela’s National Assembly has been led by the opposition since elections in December 2015, and has become a focal point for critics of the president.
Anti-Maduro protesters have staged nationwide street protests against the government over the past three months which have seen violent clashes between demonstrators and the security forces.
At least 90 people have died in the bloodshed, with both political factions blaming each other.
Image copyright AFP/Getty Images
Image caption President Maduro was attending Independence Day celebrations as the violence broke out
Just hours before the scenes at the National Assembly, Venezuela’s attorney general was facing suspension for refusing to appear in court.
The charges filed against Luisa Ortega Díaz came after she challenged President Maduro’s reform plans.
She says she is being legally pursued for defying the president, but the Supreme Court, which is dominated by government loyalists, says Ms Ortega has committed serious errors.
In pictures: Venezuela opposition step up protests
One crazy day in Venezuela
Last week, Ms Ortega strongly criticised President Maduro after an incident in which a stolen police helicopter flew over Caracas, dropping grenades and firing shots.
Media captionThe helicopter circles buildings before gunshots and a bang are heard
Venezuela helicopter attack: Who is pilot Oscar Pérez?
The president called it a “terrorist attack” but Ms Ortega said the country was suffering from “state terrorism”.
While Venezuelan security forces later found the abandoned helicopter near the coast, opposition politician and parliamentary speaker Julio Borges said there was a possibility that the incident was a hoax.
On Tuesday, the fugitive policeman who piloted the helicopter, Oscar Pérez, posted a video online saying he was still in Caracas.
He urged Venezuelans to stand firm in the streets in protests against President Maduro.