HONG KONG — Hong Kong’s pro-democracy lawmakers have lost two seats in the territory’s legislature, another setback for the bloc whose members were previously disqualified after modifying their oaths of office to defy Beijing.

While the pro-democracy camp widely anticipated losing one of the four vacated seats up for a vote in Sunday’s by-election, a second loss, by a margin of just over 1 percent after a recount, was a less expected and more painful blow.

The vote came on the same day that China’s Communist Party-controlled legislature approved a measure to drop term limits for president, clearing the way for President Xi Jinping to rule indefinitely.

Hong Kong’s democracy advocates framed the vote in the semiautonomous territory as a way to stand up to the authoritarianism of China’s central government. What they were left with, however, was a further erosion of their already limited power.