"With our souls, with our blood, we will sacrifice for you, Bashar," and "Long live Syria!" chanted many in the crowd.
Many among the estimated 2.5 million refugees scattered across neighboring countries abstained from a vote they regard as bogus. Still, long lines of Syrians formed at embassies in Jordan, Iraq and Iran and elsewhere.
A few countries including France and Germany banned Syrians from voting. But in Sweden, which has received some 30,000 Syrian asylum seekers since 2011, Syrians from opposing sides of the conflict gathered outside the embassy in Stockholm to express their views and cast their ballots.
Police stood between the two groups as emotions ran high, with pro-Assad Syrians outnumbering those opposing him.
Syrian opposition activists fighting to topple Assad and their Western allies have denounced the election as a sham since it is taking place amid a brutal civil war.
The government in Damascus, meanwhile, has touted the vote as the political solution to the 3-yearlong conflict.
Despite the carnage in Syria, Assad has maintained significant support among large sections of the population, particularly among Christians, Alawites and other religious minorities. That support has been reinforced as Islamic militants gained more strength among the rebels fighting to topple him.
Assad hails from the minority Alawite sect, an offshoot of Shiite Islam that has ruled Syria for the past four decades. The overwhelming majority of rebels are Sunni Muslims.
Bassem Zammam, a 45-year-old Syrian sculptor who arrived in Sweden 45 days ago, said he voted for Assad, "not because I like Assad, but because I like Syria."
"I like stability, I like (the safety) that we missed because of those savages," he said, adding that he initially supported the rebels but changed his view because he felt they weren't really seeking freedom. He said mortar fire had injured his children and destroyed his house.
In Lebanon, a country of 4.5 million people that has long been dominated by its Syrian neighbor, the election turned into a massive show of support for Assad and his Lebanese ally, the Shiite militant Hezbollah group.
The clashes in Yarze broke out when Syrian voters started pushing against the Lebanese soldiers in an effort to get into the compound. Soldiers beat the voters with batons and sticks and were even seen slapping few people in an effort to control them. Overwhelmed by the crowds and the heat, several people fainted. Red Cross volunteers ferried at least 20 people away.
Polls in Lebanon were to be open from 7 a.m. to 7 p.m., but Syrian Ambassador in Beirut Ali Abdel-Karim Ali said voting would be extended until midnight.
There was pandemonium inside the embassy as well. Voters pushed inside a small room with four ballot boxes and voted publicly. At times, election workers were seen grabbing the ballots and stuffing them inside the boxes themselves. No one appeared to be checking who was voting or how many times.
People began arriving at dawn, some on the back of pickup trucks, others in cars and buses plastered with the Syrian white-red-and-black flag, the yellow Hezbollah flag and pictures of Assad and Hezbollah chief Hassan Nasrallah. Many abandoned their cars to walk the last few kilometers (miles) to the embassy because traffic was at a standstill.
"I came to vote for President Bashar Assad because we love him and he is a good man," said Abraham Dekermenjian, a Syrian of Armenian descent who fled from his war-devastated city of Aleppo.
Dekermenjian, formerly a plastic factory worker, spoke as he took a break from walking, sitting on the pavement, a cigarette in one hand and a bottle of water in the other.
Wahid Ibrahim al-Beik, a 30-year-old minibus driver in Lebanon, had a Syrian flag tied around his neck and a headband around his forehead that read: "Syria is protected by God."
"I am going to vote for his excellency President Bashar Assad because there is no one like him and we don't accept anyone other than him," he said.
There are about 1.1 million Syrians who live in Lebanon as refugees. Even before the Syrian war, Lebanon had close to a million Syrian workers who have lived in Lebanon for years.
Many among the refugees and opposition supporters abroad were boycotting the election. Two other candidates are in the race, but they are seen as mostly symbolic contenders and little known figures.
In the eastern Lebanese town of Marj, a tented settlement for refugees was half empty Wednesday morning. Residents said some were at work, others had gone to vote. Some said they felt compelled to vote out of fear that Syrian authorities were monitoring them.
"We don't want to vote, but if we don't and they don't let us go back to Syria, what do we do then?" said Kifah, a refugee from the rebellious eastern Ghouta region near Damascus. She declined to give her last name because of security concerns.
In Amman, where the government has supported the rebels trying to topple Assad, dozens gathered outside the Syrian Embassy to protest the voting. Some carried placards that read: "Anyone who votes has no morals."
"My son was one of the people who started the protests against the regime. He was unarmed but they killed him," said a Syrian woman from Damascus who identified herself as Um Mutazz al-Shaar.
Lima Darazini, a pro-government voter from Aleppo, said she voted for Assad. "Why? Because we used to live in safety during his rule, and because we love him."
Inside Syria, the government pressed on with its offensive in the north aimed at reclaiming rebel-held territory along the border with Turkey and inside Aleppo, activists said.
The Britain-based Syrian Observatory for Human Rights said military helicopters dropped several so-called barrel bombs on Aleppo's rebel-held district of Maghayir on Wednesday, killing at least 21 people, including three children and two women.
Associated Press writers Zeina Karam and Diaa Hadid in Beirut, Bassam Hatoum and Hussein Malla in Marj, Lebanon, Omar Akour in Amman, Jordan, and Malin Rising in Stockholm, Sweden contributed to this report.