The Western world recoiled from China in 1989 after its Tiananmen Square massacre of student activists. Tim Walz followed through with a plan to teach in the country.

After graduating from Nebraska’s Chadron State College that year, Walz, then 25 years old, went to teach English and American history to high-school students in Foshan, a city in China’s southern Guangdong province, as part of a yearlong Harvard University program blessed by Washington.

The Minnesota governor and freshly minted Democratic vice-presidential nominee has described the experience as humbling and formative. It was also the first of some 30 visits that Walz has made to China as educator, businessman and politician that took him to far corners of the country and have given him insight into America’s relationship with its biggest global competitor.

“As I always say, I’m about one trip away from knowing nothing about China,” Walz told a congressional panel in 2016. “It feels like it’s complex, it’s difficult.”

His sustained association with China contrasts with his Republican rivals, former President Donald Trump and Sen. JD Vance , as well as Democratic presidential nominee Vice President Kamala Harris , who has never set foot on mainland China. His China connection isn’t highlighted online by the Harris-Walz campaign, but Walz’s past comments on China suggest that his primary interest in the country as a politician has been its poor human-rights record.

The connections have also opened Walz to attacks from Republicans who suggest Walz’s fascination with the communist-ruled nation makes him soft on China. Arkansas Sen. Tom Cotton wrote Aug. 6 on X, “Tim Walz owes the American people an explanation about his unusual, 35-year relationship with Communist China.”

Addressing GOP criticisms, the Harris-Walz campaign said in a statement, “Throughout his career, Gov. Walz has stood up to the [Chinese Communist Party], fought for human rights and democracy, and always put American jobs and manufacturing first.” It also accused Republicans of twisting facts to distract from their record on China.

After teaching, Walz formed a travel company and for years led American students on tours to China—one in 1994 doubled as his honeymoon, according to a profile that year in the Star-Herald of Scottsbluff, Neb. In fact, Walz planned his wedding date to coincide with the fifth anniversary of the Tiananmen crackdown on June 4: “He wanted to have a date he’d always remember,” his future wife, then known as Gwen Whipple, told the newspaper.

As a politician, Walz gained access to more elite members of Chinese society, recalling in one interview “a spirited debate” he held with a former premier of China. And he once posted online a photo of himself meeting Beijing’s Tibetan nemesis, the Dalai Lama, and has met Hong Kong activist Joshua Wong .

Walz’s very presence in China following the Tiananmen crackdown made him a figure in a broader U.S. policy by then-President George H.W. Bush to maintain a working diplomatic relationship with China, even in the face of widespread condemnation of Beijing in Washington that included calls to cut bilateral ties. Still, the U.S. relationship with China suffered after the incident, including the imposition by Bush of sanctions on Beijing that included a downgrade in some diplomacy.

Walz has said his decision to continue with the teaching program despite the crackdown angered some observers. “But it was my belief at that time that the diplomacy was going to happen on many levels, certainly people to people, and the opportunity to be in a Chinese high school at that critical time seemed to me to be really important,” he told fellow members of a congressional panel in 2014.

Walz grew fascinated with Communist China as a youth and during his teaching program learned some Mandarin, according to a Minneapolis Star-Tribune profile several years ago, though videos online suggest his language proficiency is limited.

After he went to Washington as a Minnesota congressman in 2007 Walz aligned with politicians on both sides of the aisle focused on China’s weak human-rights record—and he referred often to his experience in 1989. One of his official trips to China as a congressman was part of a rare American delegation to Tibet led by then House Minority Leader Nancy Pelosi .

Like most American politicians in Washington, Walz was once a proponent of delinking China’s human-rights record from policies related to trade, and specifically China’s most favored nation trading status that was threatened after Tiananmen.

But by 2016 as Chinese leader Xi Jinping consolidated power, Walz also viewed the country’s human-rights situation as “getting worse not better,” he said in Congress that year. He cited the undermining of nongovernmental organizations, Catholics and other religious groups and lawyers, and has expressed concern about China’s treatment of its people in Hong Kong, Xinjiang and Tibet.

“We cannot decouple economic growth from human rights growth,” he said. “We cannot—and as a nation, we need to hold—hold those ideas up.”

China’s government has declined to comment on the U.S. presidential campaign, including Walz and his ties to the country. Asked about Walz this week, Foreign Ministry spokeswoman Mao Ning said, “The U.S. presidential election is the domestic affair of the U.S. We have no comment on it,” while adding Beijing hopes the U.S. will “work for the steady, sound and sustainable development of China-U. S. relations.”

​One of the few references to Walz’s teaching background in official Chinese statements was a mention in a 2019 Foreign Ministry press release that said the country’s acting Chicago Consul General Liu Jun​ had ​attended Walz’s inauguration as Minnesota governor. In addition to congratulating the governor, the consul expressed hopes Walz could help promote friendly and cooperative ​relations between the state and China, the statement said.

Write to James T. Areddy at James.Areddy@wsj.com