SEOUL, South Korea — The police on Saturday fired water cannons and tear gas at thousands of protesters shouting for President Park Geun-hye’s resignation while marching toward her office in Seoul in the largest antigovernment demonstration here in several years.

Tens of thousands of people wearing plastic raincoats filled a City Hall plaza in downtown Seoul, brought together by a host of antigovernment grievances, including Ms. Park’s recent decision to replace privately published school history textbooks with a uniform, government-issued text.

The crowd, many of whom chanted “Down with Park Geun-hye!” and “No to layoffs!” surged down a 10-lane boulevard toward Ms. Park’s presidential office, the Blue House, several blocks away. Officers blocked the marchers with barricades they built using 700 police buses linked together across the main street and other roads leading to the presidential compound.

While police water cannons blasted their ranks, demonstrators tried to create breaches by tying ropes to buses and pulling at them. Buses were coated with cooking oil to stymie protesters who tried to climb over. Riot police officers armed with plastic shields also guarded the roofs of the vehicles, repelling protesters, some wielding steel pipes and bamboo sticks as they approached the buses.