Bernie Sanders has wryly observed that the media used to refer to him as “the longest-serving independent in the history of the United States Congress.” But now that he is running for president, Sanders says, he’s more often described as a “self-professed democratic socialist.”

Both labels are accurate descriptions of the rumpled 74-year-old senator from Vermont, who has surprised most everyone with the strength of his run for the Democratic presidential nomination in a field led by Hillary Rodham Clinton.

Sanders was born in Brooklyn and attended the University of Chicago, where he was active in the civil rights movement -- protesting the school’s segregated housing policy, among other things -- and joined the Young People’s Socialist League.

He now lives in Burlington, Vt., where he was first elected mayor as an independent in 1981 -- by just 10 votes. Sanders was reelected three times before winning Vermont’s only seat in the U.S. House of Representatives in 1990. He has served in the U.S. Senate since 2007.

Since launching his presidential bid in April, Sanders has drawn eye-popping crowds to his rallies around the country, including an estimated 24,000 people in Boston earlier this month. His supporters often profess their devotion with signs declaring “Feel the Bern.”

Sanders rails against the political influence of the “billionaire class,” and he touts an array of liberal policy prescriptions. Among them: free college tuition, a single-payer health care system, a $15 minimum wage and guaranteed sick time and medical leave for workers.

He says he draws inspiration from Scandinavian countries where democratic socialist governments offer citizens more generous benefits.

Sanders has been introduced at rallies by the founders of Ben & Jerry’s ice cream, fellow Vermonters, and he has a long list of celebrity backers, including actor Will Ferrell, comedian Margaret Cho, rapper Christopher ‘Lil B’ McCartney and rocker Flea of the Red Hot Chilli Peppers.

Sanders has a reputation for being a little grumpy but also has a sense of humor and has gamely sought to advance his vision for a fairer America through pop culture as well as in the halls of Congress. He has recently poked fun at himself during appearances on “The Late Show with Stephen Colbert” on CBS and “The Night Show with Larry Wilmore” on Comedy Central. And on Thursday, Sanders is booked to appear on “Ellen.”