Vice President Kamala Harris picked Minnesota Gov. Tim Walz as her vice-presidential running mate, selecting an avuncular Midwesterner and former high-school teacher who in recent years has signed into law policies popular with the Democratic base.

A two-term governor and current chairman of the Democratic Governors Association, Walz could be especially helpful in the battleground states of Wisconsin and Michigan . He is already well known in western Wisconsin because it shares media markets with Minnesota, while Michigan has some economic and cultural similarities with the state he now governs.

Walz wasn’t widely known outside of Minnesota before his name appeared on Harris shortlists. But he gained some Democratic fans outside his state in recent weeks for television interviews that hit at former President Donald Trump and his running mate , Ohio Sen. JD Vance , without being overly nasty. He called the pair “weird,” a word that went viral among Democrats.

Harris bypassed Pennsylvania Gov. Josh Shapiro , another finalist for the job who was viewed as a more conventional pick because he had the potential to help deliver a key battleground state.

But Shapiro’s selection might have also angered some progressives because he has supported private-school vouchers and is a vocal supporter of Israel at a time when some activists on the left have condemned the Biden administration’s handling of the war in Gaza . Harris’s choice of Walz was earlier reported by CNN.

Trump’s campaign in a statement suggested the selection represented a doubling down on progressivism.

“It’s no surprise that San Francisco Liberal Kamala Harris wants West Coast wannabe Tim Walz as her running-mate,” the statement said. “Walz has spent his governorship trying to reshape Minnesota in the image of the Golden State.”

At 60 years old, Walz is slightly older than Harris (she turns 60 in October). He is also a hunter and gun owner, which can often help candidates connect in rural areas.

Walz was viewed by some Minnesotans as a moderate Democrat when first elected governor in 2018 because he had grown up in small-town Nebraska, enlisted in the Army National Guard at 17, was elected to Congress from one of the state’s more conservative districts and once earned the National Rifle Association’s endorsement.

But he has governed more to the left than some initially expected. Walz supported universal free school meals for students, voting rights for the formerly incarcerated, driver’s licenses for migrants who crossed the border illegally, recreational marijuana and signed a law that made abortion a “fundamental right.”

To win in November, Harris likely needs to do the reverse of what Walz did. She already is distancing herself from some of the more progressive parts of her record—some dating from her 2020 Democratic presidential primary campaign—in a gradual move to the middle, even as Trump works to brand her a “San Francisco liberal.”

Minnesota Republicans have suggested Walz was slow to call out the National Guard to address rioting that started after the Minneapolis police murder of George Floyd in 2020.

The rioting resulted in significant damage, including a police precinct being set on fire. Walz deployed hundreds of National Guard troops three days after Floyd’s murder as looting and arson spread. City and state officials have blamed each other for the response. After-action assessments found a breakdown in communication between government officials, the Minneapolis-based Star Tribune newspaper has reported.

Walz appears as comfortable in front of voters wearing a flannel shirt and baseball cap as he is in a suit and tie, giving him a naturalness that has served him well on the campaign trail.

After graduating in 1989 with a social-science degree from Chadron State College in Nebraska, Walz spent a year teaching in China before returning to full-time status at the National Guard and then a teaching career. He eventually landed about 80 miles southwest of Minneapolis in Mankato, Minn., where he taught social studies, coached high-school football and raised two children with his wife, Gwen Walz.

He also continued in the National Guard, where he specialized in field artillery and did a tour overseas, although he never saw combat. After 24 years in the National Guard, he rose to the rank of command sergeant major before running for Congress in 2006.

In his early 40s, Walz entered politics and managed to unseat a six-term Republican congressman in a mostly rural southern Minnesota district. His humor, polished by years of trying to keep high-schoolers’ attention, has been a strength throughout his political career.

After 12 years in Congress, Walz ran for governor as someone willing to compromise with Republicans. He won by 11.4 percentage points in 2018, almost four points higher than his 2022 re-election victory.

Under his tenure, the state also passed paid family and medical leave, sick leave, transgender-rights protections, a tax credit aimed at low-income parents, and a $1 billion investment in affordable housing.

“If you need a reminder that elections have consequences, check out what’s happening in Minnesota,” former President Barack Obama wrote on social media last year .

Walz might have some historical trends going his way. Minnesota has already been home to two vice presidents, Hubert H. Humphrey and Walter Mondale , enough to rank in the top 10 states. Also, roughly a third of all past vice presidents have been governors, according to the Eagleton Institute of Politics at Rutgers University.

Write to John McCormick at mccormick.john@wsj.com and Tarini Parti at tarini.parti@wsj.com