Assad visited the east Damascus district of Jobar, state media said.
Heavy fighting in the strategic neighbourhood killed at least 25 Syrian soldiers and pro-regime militia on Wednesday before the visit, according to the Syrian Observatory for Human Rights group.
The president's official Facebook and Twitter accounts carried photographs of him in civilian clothes talking with two soldiers by a tank and shaking hands with a third.
"As the New Year begins, President Assad is in Jobar with the soldiers of the Syrian Arab Army," the caption said.
Signup to our newsletter and follow us on Facebook and Twitter!
"If there is still a bit of joy in Syria, it is thanks to the victories you are winning against terrorism," Assad was quoted as saying.
Syrian state television also aired footage of the visit, showing Assad sharing a meal with troops and being saluted by soldiers.
Since the uprising against his rule erupted in 2011, Assad has made few visits outside the confines of his tightly-guarded palace.
More than 200,000 people have been killed since the conflict began, and millions have been displaced by the fighting.