The ban, announced Thursday toward the end of an opposition-led general strike that shuttered some businesses nationwide for two days, begins Friday and continues through Tuesday, interior and justice minister Néstor Reverol said.
He prohibited "all public meetings and demonstrations, gatherings and other similar acts that might disturb the electoral process."
Those who run afoul of the ban risk prison sentences of five to 10 years, he said.
The move comes as Venezuela, in the midst of an economic and political crisis that has spurred street protests for months, prepares for Sunday's vote called by President Nicolás Maduro.
Voters will elect representatives for a 545-seat special assembly that would have powers to rewrite the South American country's 1999 constitution
and dissolve state institutions.
Maduro's critics say the new body would essentially replace the opposition-led National Assembly, and allow Maduro supporters to give him more sweeping powers. Maduro has said that rewriting the constitution is needed to restore order, apply justice and re-establish peace.
It wasn't immediately clear how effective the protest ban would be. Opposition leaders already have called for mass demonstrations Friday in the capital, Caracas.
Maduro, during a huge rally for his supporters, told the crowd he has proposed talks with the opposition, "a table for dialogue and reconciliation for the homeland."
The President said he wanted to avoid more violence and the opposition should stop protesting in the streets. "A table of peace. A real table of peace," Maduro shouted. "I would be happy if we could install this before the (vote)."
Freddy Guevara, vice president of the National Assembly, said Thursday evening that protests will continue through Sunday.
"We will not kneel, we will not fail. We will fight," he told reporters.
US to embassy families: Leave now
As the election drew closer, the United States began to make moves to get some of its citizens out of the country.
On Thursday, the State Department ordered family members of US embassy staff to leave the country. US government employees are permitted to voluntarily depart, an updated travel warning from the department says.
US employees who want to leave Caracas must get approval.
The department warning told tourists that US citizens have reported being arrested, detained, and robbed while in proximity to protests.
As the national strike gripped the country this week, the US and Mexico announced they were slapping sanctions on Venezuelan government officials and ex-officials
The United States announced its sanctions against 13 people on Wednesday.
"As President Trump has made clear, the United States will not ignore the Maduro regime's ongoing efforts to undermine democracy, freedom and the rule of law," US Treasury Secretary Steven T. Mnuchin said in a statement.
The United States has relayed its concerns about the upcoming elections to the Venezuelan government, a State Department spokeswoman said Thursday.
"We are prepared to continue taking strong and swift economic actions if the government of Venezuela insists on holding those July 30 constituent assembly elections," US State Department spokeswoman Heather Nauert added on Thursday. "It's an area of major concern of ours. We have asked them not to do it."
Mexico's ministry of treasury and public credit said Thursday it would impose financial restrictions against the same people.
The Mexican ministry alleged those officials were impeding democracy and human rights. It also said Venezuela's government still has a chance to push for peace and reconciliation -- by dropping plans for Sunday's election.
'Brink of civil war'
A former Venezuelan diplomat warned Thursday that his nation faced serious strife if Sunday's vote went ahead.
"If the Sunday vote goes through, we are at the brink of civil war," Isaias Medina, an envoy who represented Venezuela at the United Nations until he resigned last week, told CNN's Christiane Amanpour.
Protesters, he said, "are fighting for the right to bring the rule of law back to the country, and they will not stop," he said. "And this means that these two forces will clash" without limits.
Medina resigned in protest against his government and called on Maduro to resign.
7 killed during strike; 4-month death toll at 108
Some Venezuelans stayed home from work for a second day Thursday, heeding the opposition's call for a 48-hour general strike in protest of Sunday's elections.
Opposition leaders pointed to pictures of empty streets in the capital as evidence the strike was working.
But some people also were out on the streets Wednesday and Thursday in anti-government protests, some of which turned deadly.
At least seven people died Wednesday and Thursday in incidents related to protests, the nation's attorney general's office said, without elaborating on who, if anyone, was behind their deaths.
That included a 49-year-old man who died Thursday during a protest near Valencia, about 100 miles west of Caracas, and a 16-year-old boy who had been shot at a protest on Wednesday and passed away a day later, the office said.
Police with riot gear and shields clashed Wednesday with masked protesters who threw rocks and Molotov cocktails.
As of Thursday, 111 people have been killed in Venezuela's political unrest since April, the attorney general's office said. More than 1,900 people have been injured.
About 378,000 troops have been deployed nationwide, state-run television station VTV reported online, citing Adm. Remigio Ceballos.
Strike has some effect
Guevara posted pictures of near-empty Caracas streets to his Twitter account Thursday, saying they showed that Venezuelans there were answering the call to stay home from their jobs.
"All of Caracas empty, showing firmness in its objective to reach freedom," he wrote in one tweet.
Not all of the capital was empty. People more sympathetic to the government crowded some Caracas streets Thursday afternoon, images from VTV showed.
Thursday is the last day for candidates in Sunday's election to campaign.
A government minister, Rodolfo Marco Torres, posted pictures and videos of people rallying in support of Sunday's election. "We're a united people, a sovereign country, the love of Chavez, and we walk towards victory with our President Nicolas Maduro," Torres wrote in one tweet, referring to Maduro's late predecessor, Hugo Chavez.
In a southern section of Valencia, scores of people marched in support of the government Thursday, Catherine Carazas told CNN.
"Everything is normal here, but I heard that in the north zone of Valencia, people did participate in the strike," Carazas said.
Most businesses were closed Thursday in the town center of San Antonio de los Altos, just southwest of Caracas, Eddie Espinoza told CNN.
Espinoza posted a video showing a near-empty street in the town Thursday morning.
Bloodshed and dire conditions
For months, violence has spiraled out of control as the struggle for food and medicine grows.
The political upheaval intensified in late March when the Venezuelan Supreme Court dissolved Parliament and transferred all legislative powers to itself. The opposition claimed Maduro was creating a dictatorship.
The decision was reversed three days later, but it triggered a series of bloody street protests that have lasted for months.
Meanwhile, two airlines have announced they will be suspending flights to Venezuela.
Colombian airline Avianca said Thursday it has stopped flying to its South American neighbor indefinitely, saying Venezuela needs to improve its airport infrastructure.
Delta, meanwhile, has said it will suspend its lone, weekly route to Venezuela
-- a flight between Atlanta and Caracas -- starting in mid-September, citing unstable market conditions. The airline drastically cut service to Venezuela three years ago because of a currency dispute with the government.