Gavin Newsom cruised to an easy victory Tuesday night over John Cox in the race for California governor.

Newsom, 50, channeled opposition to President Trump in the deep-blue state, winning a race that never seemed like a genuine contest.

Newsom fulfilled an ambition that he had been pursuing for nearly a decade. In 2009, he launched a campaign for governor but failed to gain traction in the primary against Jerry Brown. He dropped out and ran for lieutenant governor, an office he has held for the last eight years.

With few formal responsibilities, Newsom served in Brown’s long shadow. He is still best known for his decision, as San Francisco mayor, to issue marriage licenses to gay couples in 2004. In recent years, he has championed ballot initiatives that legalized recreational marijuana and imposed gun control provisions.

The campaign largely focused on issues like homelessness, housing affordability, and health care. Newsom has pledged to develop 3.5 million new housing units by 2025 — an ambitious target. Newsom has also endorsed a single-payer health care plan for California, though he has sought to play down expectations that such a goal could be met in the near term.

Newsom largely ignored Cox, a Republican who based his campaign largely on an effort to repeal the state’s gas tax increase. Cox was a key supporter of Proposition 6, which would repeal the hike approved by the Legislature last year. In the top-two primary in June, Cox beat former Los Angeles Mayor Antonio Villaraigosa and Republican Assemblyman Travis Allen for the second spot in the race with key support from Trump.

Newsom drew heavy support from the entertainment industry, and in the waning weeks of the race all of the major studios made $14,000-plus contributions to his campaign, an indication of their confidence in his victory.