BEIRUT, Lebanon — Although Syria’s bloody six-year war is far from over, one result is already becoming clear: President Bashar al-Assad looks as though he is here to stay.

On the battlefield, no one remains who is willing and able to topple him. The rebel forces are waning, and President Trump has canceled the C.I.A. program that provided them with arms and support. The Islamic State, with its own agenda to rule Syria as a caliphate, is being routed from its strongholds.

Regional powers, foreign officials and Syrians themselves are increasingly operating as if he will rule for years to come, albeit over a greatly reduced country. His allies have begun to trumpet what they see as their impending victory, and his government is talking about rebuilding a shattered country, hosting an international trade fair last month and signing a deal with Iran to rebuild its power grid.

Even some longtime rebel supporters have grown war-weary and started to embrace the inevitable.

Since the government reclaimed control of the mountain town of Madaya after a prolonged siege, life there has improved for those who remained. The snipers left, electricity returned, and food appeared in markets. Cafes reopened, and people started going out.