DAMASCUS — Against a backdrop of civil war, tens of thousands of Syrians voted in government-controlled cities and towns Tuesday to give President Bashar Assad a new seven-year mandate, with some even marking the ballots with their own blood.
The carefully choreographed election was ignored and even mocked in opposition-held areas of Syria where fighting persisted, with some rebels derisively dropping their shoes in a phony ballot box in a show of disgust. Western leaders also called it a sham.
A victory for Assad is likely to bolster his base of support at home and provide further evidence that he has no intention of relinquishing power, making a protracted conflict the likely outcome in fighting that has already lasted three years.
Fears that the rebels would rain down mortar shells on government-controlled territory did not materialize, but fighting persisted.
State-run media reported that voting closed on midnight Tuesday, and election officials began the process of checking the number of votes against lists of registered voters to ensure numbers matched. In one central Damascus voting booth, 2,196 people cast their ballots — all but two were for Assad, counted an Associated Press reporter who watched representatives of each presidential candidate tally votes.
The announcement was accompanied by wild beeping and cheering in central Damascus by Assad supporters. It was not immediately clear when election results would be announced.
Earlier in Damascus, the dull sounds of explosions reverberated in the distance as government forces and rebels battled in nearby rural towns and plumes of gray smoke marked the skyline. Several mortar rounds reportedly hit in the capital, including one that fell near the Opera House on a major plaza.
At least three fighter jets roared low over the city, which residents said was unusual. Government warplanes and helicopters pounded the rebellious Damascus suburb of Daraya, the southern city of Daraa, and the nearby town of Nawa, as well as opposition-held districts of the divided northern city of Aleppo.
Voting took place only in government-controlled areas, excluding much of northern and eastern Syria. Tens of thousands of Syrians abroad voted last week, although many of the more than 2.7 million Syrian refugees across the region either abstained or were excluded by law.
There were ostentatious shows of support for the 48-year-old Assad, who has ruled Syria since 2000, when he took over after the death of his father, Hafez. There was a carnival-like atmosphere, with voters singing, banging drums, and dancing with Syrian flags. Chants of ‘‘God, Syria, and Bashar!’’ were heard.
At a polling station in the upscale Dama Rose hotel in central Damascus, a blue cup filled with pins was set out for those who wanted to vote in blood. Some pricked their fingers repeatedly to draw enough blood to mark the circle under Assad’s name on the ballot — an act of allegiance and patriotism that has been used in previous elections under both Assads.
Most voted in ink, though, and some made their choice for Assad in full sight of other voters and TV cameras instead of using a curtained booth for privacy.
They said reelecting Assad would give him more legitimacy to find a solution to the devastating conflict that opposition activists say has killed more than 160,000 of their countrymen, about a third of them civilians.
Most Syrians said they believed some sort of reconciliation had to take place alongside the military crackdown, which they saw as inevitable.
‘‘Dialogue can’t be a solution when somebody is waving a gun in your face,’’ said Zeina Habal after she voted in Damascus. ‘‘You speak to the people who have wisdom to understand, and you defend yourself at the same time.’’
The government has portrayed the election as the solution to the conflict, but there is no indication it will halt the violence or mend a bitterly divided nation.
‘‘Assad’s victory will not legitimize the regime, but will cement its resilience,’’ said Ayham Kamel, an analyst with the Eurasia group in London. He said the election will also reinforce the military’s recent gains and further undermine the ability of radical or moderate rebels to replace the government.
‘‘The Western countries are claiming that they are practicing democracy, so we came here to vote to show and teach them how democracy could be,’’ said George Saadeh, a resident of the overwhelmingly Christian district of Bab Touma.
Despite the civil war, Assad has retained support among a significant section of the population, including religious minorities who fear for their future.