DENVER — Voters in Colorado have elected the country's first openly gay governor. Rep. Jared Polis defeated Republican state Treasurer Walker Stapleton to keep the governor's seat in Democratic hands.

Polis, 43, is a five-term congressman and technology entrepreneur who promised to fight for universal health care, renewable energy standards and publicly funded preschool and kindergarten. He vowed to stand up to President Trump's efforts to dismantle former President Barack Obama's health care law, the Affordable Care Act. Polis will succeed the term-limited John Hickenlooper.

Stapleton is a two-term state treasurer who campaigned on defending Colorado's constitutional restrictions on taxing and spending. The 44-year-old Stapleton insisted Polis' ideas for funding K-12 education, roads and energy would bankrupt the state.

Colorado has not had a Republican governor since 2007. The state has one of the nation's lowest unemployment rates and highest rates of economic growth, largely fueled by the tech, aerospace and oil and gas industries.

Colorado Governor-elect Jared Polis, a Democrat, with running mate Dianne Primavera on Nov, 6, 2018 in Denver. Polis defeated incumbent Republican Walker Stapleton to become the first openly gay man elected governor in the country. Getty

Polis banked on defending Obama's health care law and riding a wave of anti-Trump sentiment in a state that voted for Hillary Clinton in 2016 and saw overwhelming Democratic turnout in June's party primaries.

Get Breaking News Delivered to Your Inbox Click here to view related media. click to expand

Stapleton sought to court unaffiliated voters, Colorado's largest voting bloc, by insisting that Polis would jeopardize economic growth with costly and ill-defined proposals to fund schools and roads and expand health care. He also portrayed himself as a defender of conservative fiscal policies that underlie that growth. Polis repeatedly promised to build bipartisan coalitions to invest in underfunded roads and public schools — suggesting the time has come to ask Colorado residents to loosen their strict constitutional limits on taxes and spending.

Health care was a top issue in the race. Many Colorado rural and mountain towns pay some of the nation's highest insurance premiums — and have only one provider — under the Affordable Care Act. Polis, endorsed by single-payer health care proponent and U.S. Sen. Bernie Sanders of Vermont, unapologetically called for universal health care coverage as a long-term goal and suggested a first step might be to create a regional market with neighboring states.

Stapleton praised President Trump's elimination of tax penalties for those without health insurance but said he would defend an expanded Medicaid program that covers one in four Colorado residents.

Mr. Trump endorsed Stapleton, who embraced the administration's antipathy toward so-called sanctuary cities that don't closely cooperate with federal immigration authorities. But Stapleton sought to distance himself from the president in the campaign's final weeks, arguing that Trump's scornful tweets about immigrants, women and minorities had no bearing on policy in the governor's race.

The 2018 midterms saw 26 LGBTQ candidates run for office. That includes Sen. Tammy Baldwin of Wisconsin, the Senate's first openly gay member, although she never made fighting for LGBTQ rights a central part of her platform. In Arizona, if Democrat Kyrsten Sinema wins, she will be the first openly bisexual woman elected to the Senate.