LANCASTER, Pa. — On an overcast afternoon this month, a block party was in full swing, the hot dogs were going fast, and Chris Underhill, freshly graduated from high school, was savoring a new milestone: He had registered to vote for the first time.

Filling out the form offered by a political activist not much older than him took about three minutes. But its significance was not lost on Mr. Underhill, 18, who grew up in this city on the edge of Amish country, 75 miles west of Philadelphia. An aspiring actor who helped organize a local march following this year’s deadly mass shooting in Parkland, Fla., Mr. Underhill said his everyday worries mirror those that fuel the anxieties of his generation, such as how to pay for college and losing access to health care.

And then there’s the presidency of Donald J. Trump.

“This country’s just gone off the walls since Trump got elected,” he said, echoing the impressions of thousands of new Pennsylvania voters his age. “But now I have the power to vote and make it better, starting with Lancaster and then going bigger.”

Weary of a political system that many young Americans see as rigged against their generation, and fired up to elect candidates who they believe support the issues they care about, a surge of young adults between the ages of 18 and 29 have registered to vote this year, according to data from 39 states compiled by Targetsmart, a Democratic polling firm.