BANGKOK — A deal to end two months of protests in Bangkok appeared to be weakening on Tuesday as antigovernment protesters hardened their stance on one demand while the prime minister threatened to take “necessary action” if they failed to leave their barricaded encampment by Wednesday.

The government of Prime Minister Abhisit Vejjajiva said it would withdraw its offer of elections in November if protesters did not disperse, Thai news outlets reported.

“They must end their protest,” Mr. Abhisit said. “The people have seen enough trouble already.”

Protest leaders who on Monday seemed a hair’s breadth from agreeing to a government plan for reconciliation swung to a more hard-line position Tuesday, emphasizing the emotional issue of the government’s responsibility for last month’s failed crackdown, which left 25 people dead.

What is apparently a collapse in negotiations highlights the government’s difficulty in dealing with an increasingly factionalized, skeptical and embittered protest movement. Many of the protest leaders have political ambitions and appear eager to leave Bangkok only with an unambiguous victory.