The assault in the north-western city of Valencia was carried out by 20 people, he said. Two were killed, one was injured and seven were arrested.
Earlier, a video posted on social media showed uniformed men saying they were rising against a “murderous tyranny”.
Despite the incident, the situation appears to be calm in the country.
On state television, Mr Maduro congratulated the army for its “immediate reaction” in putting down the attack in the early hours of Sunday, saying they had earned his “admiration.”
He called the incident a “terrorist attack” carried out by “mercenaries”, and said the security forces were actively searching for those who had escaped. “We’ll get them,” he vowed.
Military vehicles were patrolling the streets in and around Valencia and at least one helicopter was being used in the operation.
The government said that those arrested included a first lieutenant who had deserted. It said the others were civilians wearing uniforms.
- Venezuela crisis explained
- Throughout these past four months of often violent protests in Venezuela, the country’s army has, several times, reaffirmed its “unconditional loyalty” to President Maduro.
The opposition has tried to test that loyalty. When they organised an unofficial referendum last month to let Venezuelans have their say on the Constituent Assembly, one of the questions asked was whether people wanted the armed forces to defend the existing constitution.
So far, the army has remained by Mr Maduro’s side but the video that surfaced on Sunday claiming to be from the 41st Brigade in Valencia and calling for military and civilian action to restore order to the country is an interesting development. One, of course, denied by the Maduro administration who said that most of the men in the videos were civilians, led by a deserter.
But with an economy being pushed to the brink, how long can he enjoy military backing? After all, soldiers have families and nobody can escape the food shortages and spiralling inflation faced by millions every day. And with criticism being heaped upon him for what opponents call a creeping dictatorship, you have to wonder when, not if, the tipping point will come.
- What lies ahead for divided Venezuela?
Mr Maduro said they had been backed by anti-government leaders based in the US and Colombia.
There were some demonstrations of support to the uprising in Valencia but they were dispersed with tear gas, witnesses said. Elsewhere in the country, the situation remained calm.
In Sunday’s video, a rebel leader who identified himself as Juan Caguaripano, said that his group – which he called the 41st Brigade – was taking a stand against the “murderous tyranny of President Nicolás Maduro”.
“This is not a coup but a civil and military action to re-establish constitutional order.”
Violent demonstrations since April have left more than 100 people dead in the country which, despite being oil-rich, is experiencing severe shortages of food and medicines, as well as inflation in excess of 700%.
The incident in Valencia came the day after the first session of the newly inaugurated Constituent Assembly, seen by the opposition as a way for the left-wing president to cling to power.
But Mr Maduro has repeatedly said that the new body would bring peace to the country
The Constituent Assembly has the ability to rewrite the constitution and could override the opposition-controlled parliament, the National Assembly.
On Saturday, it immediately voted to dismiss Chief Prosecutor Luisa Ortega, a former ally of President Maduro turned major critic.