His visit comes as a car bomb in Idlib province kills at least 10 people
Syrian President Bashar al-Assad delivered prayers for Islam's Eid al-Fitr holiday in Hama on Sunday, the furthest he has travelled inside Syria in years, showing his growing confidence.
His visit came as a car bomb in rebel-held Idlib province killed at least 10 people, the Syrian Observatory for Human Rights reported.
State television broadcast footage of Assad standing to pray in a large mosque in Hama behind its imam, with other clerics standing alongside and a large crowd of worshippers.
State news agency SANA quoted the preacher as saying that Assad's presence in the city for Eid showed that victory and the return of security were only "a few steps" away.
Syria's civil war has turned to Assad's favour since 2015, when Russia sent its jets to help his army and allied Shia militias backed by Iran turn back rebels and win new ground.
— Asaad Hanna (@AsaadHannaa) June 25, 2017
Since the war began in 2011, it has killed hundreds of thousands, driven millions more from their homes, sparked a global refugee crisis and drawn in regional and world powers.
The conflict is far from over. Rebels hold swaths of the country, including around Idlib province near Hama, and launched a new attack in Quneitra in the southwest on Saturday.
Rebels also hold the Eastern Ghouta area near Damascus, parts of the desert in the southeast and a large pocket south of Hama around the city of Rastan.
As recently as March, rebels advanced from Idlib province to within a few kilometres of Hama, before the army and its allies pushed them back in weeks of fierce fighting.
However, the army drove rebels from their biggest urban stronghold in Aleppo in December and have also forced several important rebel enclaves to surrender over the past year.
First visit to Hama during war
Assad has not made a declared visit to Hama, which is about 185km from Damascus, since the war began. Last year he delivered Eid prayers in Homs, about 40km closer to Damascus.
Early in the crisis he visited Raqqa, a city that has since become the Syrian capital of the Islamic State (IS) group and now faces an assault by a US-backed coalition to drive out the militants.
The fight against IS, which has attacked Western cities, has become the focus of Western leaders, some of whom have softened demands that Assad must quit to end the crisis.
In March, US Secretary of State Rex Tillerson said Assad's fate would be decided by Syrians, a change in rhetoric after years of insisting he step down to allow a political solution.
France's new president, Emmanuel Macron, said this month he did not see Assad's departure as a condition to end the fighting and the priority was stopping Syria becoming a failed state.
The US and other Western states, along with Turkey and Gulf monarchies, have long supported some of the rebels, an array of groups that includes Islamist and nationalist factions. Assad describes them all as terrorists.
His military has said its focus is on the campaign in the desert, where it is advancing against IS to relieve a besieged government enclave in the city of Deir al-Zor.
Car bomb in Idlib
A car bomb killed 10 people in Syria's rebel-held Idlib province on Saturday, the Syrian Observatory for Human Rights, a Britain-based war monitor, reported on Sunday.
The attack occurred in a market in the town of al-Dana, located in the north of the province near the border with Turkey, according to the Observatory.
Three people under 18 were among the dead and the blast also injured at least 30 other people, it said. Another bombing in the town after midnight on Friday killed two people, it added.
Rebel groups in Idlib province have been sporadically fighting each other since early this year. Rebels have also accused IS of carrying out attacks in the area.
Idlib province is a major stronghold of rebels in Syria and is situated along the border with Turkey, one of the main backers of their rebellion against Assad.
Large numbers of fighters, along with their relatives and many other civilians, have moved into the area under amnesty after surrendering to the army in other parts of Syria.