Assad attended morning prayers at the Al-Hamad mosque in northwest Damascus on Eidul Fitr, the Muslim holiday marking the end of the fasting month of Ramazan, the SANA news agency reported.
He was accompanied by "high-ranking officials from the (ruling Baath) party and from the state," it added.
Read: Eid moon sighted in Saudi Arabia, Qatar, UAE
Photographs published by the news agency showed a smiling Assad surrounded by religious figures.
A photograph published by the president's official Twitter account showed him kneeling in prayer beside other officials.
The mosque's imam, Sheikh Mohammad Sharif al-Sawaf, "prayed to God to save Syria, its leader, its army and its people, and to bring victory against its enemies."
"The Syrian army will continue to defend the country," Sawaf said in his sermon, SANA reported.
Read: 34 dead in rebel rocket fire on Syria's Aleppo: monitor
Damascus has been largely spared the devastation wrought on other Syrian cities by more than four years of civil war, although there has been periodic mortar and rocket fire by rebels entrenched in the suburbs.
Assad has made few public appearances since the uprising against his rule erupted in March 2011.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ