The government of President Nicolas Maduro blamed the violence on the "fascist" opposition.
The opposition immediately distanced itself from the violence, which came an hour after the end of a peaceful anti-government Youth Day march in the capital.
Youth Day commemorates teenagers who fought and died in a Feb. 12, 1814, battle in Venezuela's war of independence from Spain.
Wednesday's march called for the Interior Ministry to release five students who were detained by police in anti-government protests in western Venezuela last week.
Protesters have been calling for Maduro to resign and complaining about economic hardships, soaring crime and rampant corruption for the past two weeks.
Anti-government protests were also staged Wednesday in front of the Venezuelan embassies in Chile and Colombia, Spanish newspaper El Pais and Colombian news channel Nuestra Tele Noticias 24 Horas reported.
In the Caracas violence, which started in the afternoon, several hundred protesters, mostly young men, fought with police. The violence persisted into the night.
Protesters threw stones, bottles and Molotov cocktails, set police cars and tires on fire, and blocked a main thoroughfare, while riot squads responded with tear gas and nightsticks, El Pais and NTN24 said.
The BBC and witnesses said they also heard gunfire.
The dead included a pro-government activist and an anti-government student, Attorney General Luisa Ortega Diaz said. A third young man also died of a gunshot wound later Wednesday, said Ramon Muchacho, the mayor of Caracas' upscale Chacao district.
At least 23 people were injured, authorities said.
More than 30 people were arrested, Interior Minister Miguel Rodriguez Torres told reporters.
He said those who were arrested wore hooded sweatshirts and carried "bags with Molotov cocktails, rocks and other objects to attack police."
Rodriguez Torres called the hostility "a premeditated act of violence against police and against the Venezuelan people."
NTN24, the only broadcaster showing live video of the violence, had the plug pulled on its cable signal, it said.
William Castillo, president of the government's regulatory National Telecommunications Commission, said he ordered all cable providers to stop carrying the NTN24 signal because the broadcast "promoted violence," which is "a crime," El Pais reported.
NTN24 Director General Claudia Gurisatti called the suspension of its signal "censorship, a violation of the right of citizens to be informed and an attack on freedom of expression."
No Venezuelan TV station broadcast the violence.