It’s finally official: Sen. Bernie Sanders has won the California primary, guaranteeing him an influx of delegates and momentum as he tries to stave off gains by former Vice President Joe Biden.

While this victory was expected, it’s taken on greater importance for Sanders, enabling him to claim a major Super Tuesday success after Biden swept the lion’s share of states in the past two weeks. Of the 14 states that voted on Super Tuesday, Sanders won only four. And in the week that followed, he’s picked up just one so far.

As such, this California victory is significant. The state has a whopping 415 pledged delegates, and Sanders is likely to accrue slightly more delegates than Biden statewide.

The margins, however, may not be as favorable to him as once projected.

The final outcome, after all, had Biden and Sanders within just seven points of each other. And our partners at DecisonDesk called the state with Sanders winning 34.3 percent of the vote and Biden winning 27.5 percent.

Because the two candidates both secured a sizable chunk of the vote, and were closer than expected, the California gains will help Sanders — but not by much. In the national delegate race, Biden had pulled ahead with 801 delegates to Sanders’s 657 before California numbers came in.

This win comes at a critical point in the race for Sanders.

Although Sanders began the primary strong, running even with former South Bend, Indiana, Mayor Pete Buttigieg in Iowa and scoring back-to-back wins in New Hampshire and Nevada, the competition has grown more intense after Biden won South Carolina by a landslide and racked up victory after victory since.

By coming in first in California, Sanders may recapture some of the momentum he previously had. The landscape, however, gets a lot tougher for him moving forward.

Sanders’s team invested early in California — and Latino voters

Sanders’s California victory is the result of significant investment in the state by his campaign, which established a noticeable on-the-ground presence that focused on Latino voters. According to early NBC News exit polls, Sanders wound up winning 49 percent support from Latino voters in the state, compared to Biden, who won 19 percent.

Polling had previously reflected his advantage: According to the RealClearPolitics average, he was polling ahead of Biden, the next-closest candidate, by 12 points on the day of the primary. A late-breaking poll from Data for Progress also showed Sanders in the lead and Biden in second.

Political experts say his dominance in California was driven by an effective ground game, including the extensive outreach to Latino voters, who make up 31 percent of eligible voters in California.

“Sanders’s campaign invested early, and invested in demographics where they could win and in areas where they [thought] they could win,” Sacramento-based Democratic strategist Steven Maviglio told Vox.

Sanders’s campaign set up more than 20 offices in the state beginning last year and has ramped up its presence since 2016, when he lost to Hillary Clinton by roughly 7 percentage points. The campaign also dialed up its focus on independent voters, a quickly growing bloc in California that now comprises 28 percent of the state’s electorate.

“We have put in our offices in predominately Latino communities, and we’ve been on the ground for the better part of a year,” Sanders’s California communications director Anna Bahr told Vox. “The way that the senator organizes, the very nature of the grassroots campaign — all of that resonates with the political history and legacy of Latinos in California.”

Sanders’s campaign — despite the obstacles around grassroots campaigning in the expansive state — were able to knock on more than a million doors during their time there.

The state’s more progressive lean, too, is something that likely favored Sanders. According to Gallup, California voters overall are on the more liberal end of the spectrum, compared to other states.

Because the final vote was pretty close between the two candidates, Sanders and Biden will both benefit from the delegate haul.

In California, candidates are able to win delegates if they hit the 15 percent threshold statewide and if they hit the same threshold in individual districts. Since Sanders and Biden are the only ones who’ve made the statewide cutoff — and Sanders was able to secure a larger proportion of support — it means he’s set to get more of the state-level delegates. He’s also expected to do well at the congressional district level, which accounts for 65 percent of the total delegates available.

This year, California moved its primary up from June to Super Tuesday, giving it a more decisive role in picking the Democratic nominee. Sanders’s win in California may be what helps keep him in the race.