COLOMBO, Sri Lanka — As a swelling crowd demanded that Prime Minister Ranil Wickremesinghe step down and protesters breached the gate of his office on Wednesday, security forces fired tear gas and a military helicopter circled overhead.
Earlier, as protesters marched near the prime minister’s office, security forces had tried to disperse the throngs with tear gas, but they would not budge and converged with another group. Riot police officers, many wearing gas masks and holding rifles, stood nearby air force and army forces without engaging with the crowd.
“We don’t want the robber Ranil, the bank thief, the deal thief!” the crowd chanted.
Hundreds of marchers had set off from the president’s office in the morning, including families with young children. Their numbers had been reinforced overnight by crowds arriving in the capital, Colombo, from across Sri Lanka.
As the day began outside the president’s office, the atmosphere was generally peaceful, with an air of celebration. People were digesting the news that President Gotabaya Rajapaksa had fled to neighboring Maldives.
“The thieves are running away,” said Sanjayra Perera, a university librarian who was among the thousands who had traveled to Colombo. She had brought her two children, 12 and 10, on Wednesday morning by train from the western city of Gampaha.
She said she wanted her family to be in the capital when the Rajapaksa family dynasty fell.
“This is our country,” she said. “We win.”
The crowd found patches of shade under statues, sat on the wall of an oceanfront park and waited in line, holding umbrellas to block the sun, for a chance to see the historic office building, one of three government buildings that protesters had taken over this past weekend.
Despite the uncertainty over whether Mr. Rajapaksa would resign on Wednesday, as the speaker of Parliament has said he would, and who might replace him, protesters were confident that the end of an era was near.
“This is a historical day for us,” said Randika Sandaruwan, 26, who took the train on Tuesday night with nine friends from the nearby city of Negombo. “We needed to kick out our president, and now Gota is gone,” he said, using a nickname for the president.
Mr. Sandaruwan and his friends, like many protesters, had nothing to protect them from the tear gas.
Shameen Opanayake, 22, sat on the front steps with his mother and two sisters. They had taken an early bus from their home in Kalutara, south of the capital.
“If he doesn’t step down today,” he said, referring to the president, “I don’t think so that this place will remain calm. The whole country is rejecting him.”