PORTLAND, Ore. — If Bernie Sanders wins the Oregon primary on Tuesday, his victory will have been secured back in April.

Oregon has a closed primary, meaning anyone who wants to vote for a Democratic candidate needs to be registered with the party. The Sanders campaign, which has lost every other state with a closed primary this year, launched a statewide effort here to get independents and new voters to sign up as Democrats before the April 26 deadline.

Volunteers worked the phones, made the rounds at college campuses and staked out farmers’ markets, targeting places where the young and the liberal gather.

“You say, hey, you’re feeling the Bern? They come over and register,” said Monte Jarvis, the Oregon state director for the Sanders campaign.

The number of voters who switched their party affiliation so they could vote for a presidential candidate in the primary neared 130,000,and most of them signed up as Democrats, according to the Oregon secretary of state’s office.

Although undoubtedly some of those new Democratic voters will cast ballots for Hillary Clinton, the registration effort could end up as the most critical part of the Sanders campaign in Oregon. The Vermont senator has been expected to pull off a victory here despite trailing Clinton in a recent poll.

Closed primaries have been a challenge for Sanders because his support has been stronger among unaffiliated voters, who often lean liberal or express skepticism of Clinton. The problem is compounded because young voters, who overwhelmingly back Sanders, are less likely to register with a party than their older counterparts, who are more likely to cast ballots for Clinton.

It’s a hurdle the Sanders campaign wanted to remove, or at least reduce, when it started moving staff members to the state in the month before the party-registration deadline.

Jarvis, the state director, previously worked for the campaign in Utah and Kansas, but he lives in Portland.