DAMASCUS, Syria (AP) — Waving photos of their leader and dancing with flags, thousands of Syrians pledged renewed allegiance to President Bashar Assad as they voted Tuesday in the country’s presidential election decried by the opposition as a charade.

Some stamped ballots with their blood, others chose to vote in full sight of other voters and television cameras — rather than go behind a partition curtain for privacy.

Men and women wore lapel pins with Assad’s picture and said re-electing him would give the Syrian leader more legitimacy to find a solution to the devastating three-year conflict that activists say has killed more than 160,000 people, about a third of whom were civilians.

The balloting is only taking place in government-controlled areas and Assad’s win — all but a foregone conclusion — would give him a third seven-year term in office, tighten his hold on power and likely further strengthen his determination to crush the insurgency against his rule.

The opposition’s Western and regional allies, including the US, Britain, France, Saudi Arabia and Turkey, have called the vote a sham. The so-called internal Syrian opposition groups seen as more lenient are also boycotting the vote, while many activists around the country are referring to it as “blood elections” for the horrific toll the country has suffered.

The vote is also Syria’s first multi-candidate presidential election in more than 40 years and is being touted by the government as a referendum measuring Syrians’ support for Assad. He faces two government-approved challengers in the race, Maher Hajjar and Hassan al-Nouri, both of whom were little known in Syria before declaring their candidacy for the country’s top post in April.

The government has presented the election as the solution to the conflict, but there is no indication it will halt the violence or mend a bitterly divided nation. The stage-managed balloting also will likely put to rest any illusions that the man who has led Syria since 2000 has any intention of relinquishing power or compromising to reach a political solution.

Syrian TV said Assad cast his ballot in the morning hours at a school in the posh Damascus neighborhood of al-Malki where he resides. A picture posted on his official Facebook page showed him in a dark blue suit and tie, smiling as he cast his vote, flanked by his wife, Asma Assad.

Reflecting the almost surreal nature of the vote as thousands lined up outside polling centers in the capital, cheering and waving Syrian flags, the dull sounds of explosions reverberated in the distance as pro-government forces and rebels battled in nearby rural towns. Ashy plumes of grey smoke marked the skyline.

“He is my leader and I love him,” said student Uday Jurusni, who voted using a pin to prick his own finger to draw blood. “With the leadership of Bashar, my country will return to safety.”

At a polling station in the upscale Dama Rose hotel in central Damascus, a cup filled with pins supplied by the government was on offer for those who chose to prick their fingers and vote in blood — a symbolic act of allegiance and patriotism.

Some pricked their fingers repeatedly to ensure they could draw enough blood to mark the circle under Assad’s name on their ballot. Most, though, voted in ink.

Outside the hotel, about two dozen men banged drums, waved flags and danced as they chanted, “God, Syria and Bashar!” Streets around polling centers were awash with posters of Assad.

Security was tight, with multiple rings of checkpoints set up around the Syrian capital and its entrances. Troops searched cars and asked people for their IDs.

There was no balloting in much of northern and eastern Syria, where swaths of territory are in rebel hands.

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 voting laws.

At least three flights from Kuwait, chartered by an anonymous Syrian businessman, were to bring Syrian expats home to vote. The first flight landed in the morning hours with nearly 200 people, according to an Associated Press crew at the Damascus International Airport. The people said they would vote and then immediately fly back to Kuwait.

But even as voting got under way in government-controlled parts of Syria, activists reported fighting, shelling and air raids in rebel-held areas.

In the rebel-held central town of Rastan, which has been under attack by government forces for more than two years, an activist who goes by the name of Murhaf al-Zoubi said all the local residents “want Assad to go.”

“There are no elections here, this is a free, liberated area,” al-Zoubi said.

The Interior Ministry said there were 15.8 million eligible voters, both inside and outside Syria, and that 9,600 voting centers have been set up around the country. Polls were expected to close at 7 p.m. on Tuesday evening but the ministry has said voting could be extended for five hours if there was a big turnout.

Copyright 2014 The Associated Press.