ST. PAUL — Days after nearly dying during cancer treatments, Hunter Cantrell, a 23-year-old university student, made what seemed a quixotic decision: He would run for the Minnesota House of Representatives to plead for affordable health care for all.

To the shock of nearly everyone, Mr. Cantrell flipped a Republican-held seat in the suburbs of the Twin Cities, and this month, he became one of nearly 1,700 candidates who took the seat of an incumbent in state legislatures across the nation.

The vast majority of the newcomers are Democrats, and as legislatures started new sessions this month, they were already shifting the debate in a number of states to liberal pledges made during their campaigns, including lowering health care costs, promoting gun control, and expanding access to college.

Republicans continue to hold majorities in most of the nation’s state capitals, as they have in recent years, but Democrats now control six new legislative chambers, including the Minnesota House of Representatives. Along the way, though, Minnesota — where Republicans hold a narrow majority in the Senate — became the only remaining state in the nation where control of a legislature is divided.