Gov. John Kitzhaber’s resignation takes effect Wednesday. (Kobbi R. Blair/AP)

— When the end finally came, the most ubiquitous politician in the history of Oregon had all but disappeared from public view.

Gov. John Kitzhaber (D) retreated from the State Capitol on Friday afternoon and announced his resignation in a letter, completing the sudden unraveling of his political career. Just one month after becoming the first Oregon governor to start a fourth term in office, Kitzhaber became the first to resign because of alleged misconduct, as he and his fiancee, Cylvia Hayes, continue to be investigated for misusing their influence for personal financial gain.

His resignation will take effect Wednesday, at which point Secretary of State Kate Brown (D) will replace Kitzhaber, becoming the first openly bisexual governor in U.S. history.

“I have always tried to do the right thing and now the right thing to do is to step aside,” Kitz­haber wrote in his statement.

For most of the tumultuous week leading up to his resignation, Kitzhaber seemed unsure about his own future. He twice made plans to resign, then changed his mind. He admitted making mistakes in judgment but later said he hadn’t.

Kate Brown will succeed Kitzhaber as governor. (Michael Lloyd/AP)

Even in his final, defiant statement of resignation, Kitzhaber remained inconsistent, first saying that he had “become a liability to the very institutions and policies to which I have dedicated my career” but adding that he was “confident” he had not been “dishonest or dishonorable” and would be cleared of all wrong­doing.

The governor spent 30 years as the popular stalwart of Oregon politics, only to watch nearly all of his supporters fall away as he tried to hang on to his job in the final days. The state’s attorney general launched a criminal investigation into allegations of public corruption. His allies in the Democratic Party held a news conference calling for his resignation. Brown, his successor, called his behavior “strange” and “bizarre.” Members of Kitzhaber’s staff quit before he decided to do so himself.

By the end of the week, the most significant relationship Kitz­haber had left was also the one that had led to so many problems: his engagement to Hayes, a clean­-­energy consultant and the governor’s longtime girlfriend. “I am in love,” Kitzhaber said often during the past weeks. It seemed to be both a statement of fact and his most cogent explanation for all that had gone wrong.

The story of Kitzhaber’s sudden undoing was also the story of his relationship with Hayes, who has lived with him in the governor’s mansion for several years and who often refers to herself as the “first lady.” An ethics commission and the attorney general are investigating charges that Hayes used her relationship with the governor to earn tens of thousands of dollars from private organizations to perform contracting work as a clean-energy consultant while also advising the governor on those issues for the state. On Thursday, the U.S. attorney’s office in Portland filed subpoenas seeking state records and electronic communications relating to Kitz­haber, Hayes and 15 others in the governor’s administration, the Associated Press reported.

The apparent conflict of interest was just the latest allegation in a relationship saga that has dominated the news cycle here for several months.

Kitzhaber’s scandal seemed uniquely fitted to Oregon, a place of progressive politics and low-key politicians where the governor once dressed for his ­inauguration in blue jeans. The first couple’s strange downfall ­involved accusations of a ­marijuana-growing operation and economic zealotry, with one of the biggest conflicts of interest revolving around an attempt to popularize a new economic measure called the “Genuine Progress Indicator.”

In his resignation statement, even Kitzhaber seemed surprised and hurt that political scandal had made its way to good-government Oregon, writing that the events of the last weeks were “something we might expect in Washington, D.C., but surely not in Oregon” and saying that he was troubled on a “very personal level” that so many of his longtime allies had turned against him and his fiancee.

It was only in August that Kitzhaber, 67, proposed to Hayes, 47, with an eco-friendly ring on the banks of the Rogue River. An announcement through a spokeswoman said the couple “could not be happier or more excited.” In the months since, their engagement has been disrupted by the ethics commission review, two recall campaigns, a criminal investigation, a possible FBI inquiry and a series of personal embarrassments. First Hayes admitted to a fraudulent marriage in 1997 with an 18-year-old undocumented immigrant who paid her $5,000 to help legalize his status. Then she admitted to having purchased a property in rural Washington state, also in the late 1990s, where she had hoped to grow large quantities of marijuana.

Through it all, Kitzhaber defended Hayes and their engagement, even as some of his allies framed his future as a choice between maintaining his relationship and saving his career. Late last month, during the first news conference of his fourth term, he spent the entire 20 minutes talking about the most tumultuous love story in the history of Oregon politics. He winced into the cameras. He stammered until his voice went hoarse and asked an assistant for water.

He spoke about their common interests: “climate change being one, low carbon fuels being one, measuring outcomes and metrics being another,” he said.

He addressed their apparent conflicts of interest: “We have attempted to draw a very clear line between her public role and her outside work.”

He announced his final assessment. “Marriage is still on, yes,” he said. “I have no regrets over my personal relationship with Cylvia Hayes. She is a wonderful lady.”

Theirs has been an unlikely and unconventional romance. Kitzhaber is an Ivy League- ­educated physician who served in the state’s House of Representatives and Senate before rising to governor; Hayes was raised in abject poverty outside Seattle, in a house with no running water or electricity, and dropped out of school and ran away from home at 16.

During Kitzhaber’s first term as governor in the late 1990s, Hayes was broke and desperate in Washington state, sometimes living out of her car and bathing in a pond. She worked at a chicken plant and drove heavy machinery. She eventually fled an abusive relationship, moving to Oregon with her two dogs and living for a time in a tent on government land.

Hayes put herself through college at age 26 and then earned a master’s degree in sustainability. She came to Oregon to start a nonprofit environmental advocacy group. She ran for state office in 2002 and lost, but she met Kitzhaber during the campaign. The two, both already married and divorced twice, started to date, going on trips together to ride horses and fly-fish.

When Kitzhaber decided to run for a third term as governor in 2010 after several years out of office, he made environmental sustainability a major part of his campaign platform. He won election and made Hayes an official but unpaid adviser, focusing heavily on clean energy, even as she continued to get lucrative contracts to push environmental policies for private companies. She sometimes worked from a desk in the governor’s office. She traveled to give clean-energy speeches and introduced herself as the “first lady.”

In many of those speeches, Hayes framed her relationship with the governor as proof of how quickly a life could transform. “I mean, can you believe it?” she said once, referring to the unlikelihood of a woman who had once lived on government land moving into the governor’s mansion.

“Everything can change so fast,” she said then. A decade later, their relationship has again proved that.