In response, many opposition leaders called for an election boycott.

Mr. Falcón ultimately decided to break with the rest of the opposition and run against Mr. Maduro.

Mr. Maduro attributes the country’s problems to what he calls an economic war waged against Venezuela by the United States. But most economists place the blame on poor government management, corruption and broken policies, like tight controls over foreign exchange, an overvalued currency and price controls on goods.

The government has responded to the crisis by providing people with boxes of food, including powdered milk and pasta, although most people say they arrive irregularly and do not contain nearly enough to sustain a household. The food boxes became both an incentive and a threat during the campaign, with many voters fearful that they could be cut off if they didn’t support the government.

At many polling places on Sunday, people cast their vote and then visited a so-called Red Spot — named for the ruling Socialist Party’s color — set up nearby.

At the Red Spot, voters presented the special identity card used to receive the food boxes and other services and gave their names to workers who were keeping lists of those who had voted. Workers at the Red Spots said that there was no effort to pressure voters or link a pro-Maduro vote to future food deliveries.

Mr. Falcón accused the government of violating campaign rules through the use of these Red Spots.

A woman waiting outside a polling station in a Caracas slum, La Vega, said she worked for a government agency and feared losing her job if she did not vote and report afterward at the Red Spot. The woman, who would not give her name out of fear of reprisals, also said that she felt compelled to vote for Mr. Maduro, even though she did not support him, because she was sure that government computers tracked people’s votes — a common notion here.