The students held a rally in the courtyard of Berkeley High School, according to Charles Burress, spokesman for the Berkeley Unified School District, and then marched toward the campus of the University of California at Berkeley, a city known for its progressive political sentiment.
Photos uploaded to Twitter showed hundreds of students, many of whom were carrying signs decrying the president-elect and waving Mexican flags, along with the hashtags #NotMyPresident and #BHSWalkout.
One of Trump's campaign pledges was to build a wall along the border with Mexico to keep out undocumented immigrants.
"It's time to advocate for what we feel is right," one student said into a megaphone, according to a live stream of the demonstration on the social media app Periscope.
Burress said some teachers were also demonstrating with students, though he could not provide an estimate on the number of staff joining in the action.
Smaller groups of students had walked out of classes in nearby Oakland and Seattle, Washington, according to television stations in those two cities.
Anti-Trump rallies were also planned for later on Wednesday in New York, Boston, Chicago and other cities around the country, according to social media postings. A Facebook page for a protest scheduled for Manhattan's Union Square Park showed more than 8,000 people planned to attend.
The demonstrations followed a night of protests around the Bay Area and elsewhere in the country in response to Trump's stunning political upset.
Demonstrators late on Tuesday smashed storefront windows and set garbage and tires ablaze in downtown Oakland, across the bay from San Francisco. A few miles away, students at the University of California at Berkeley students protested on campus.