Intel's stock slid Thursday after the chipmaker named interim CEO Robert Swan to the position permanently, ending a months-long search following the ouster of Brian Krzanich for what it called a "consensual relationship" with an employee.

Swan, 58, has been interim CEO for seven months and chief financial officer since 2016. He was also elected to the board, the company said. Several media outlets including Bloomberg previously reported Swan didn't want the job.

Shares of Intel fell roughly as much as 3 percent in Thursday, before paring losses to close less than 1 percent down.

In a brief interview with CNBC's Jon Fortt after the announcement, Swan said he wasn't initially interested in the job, but two things changed.

"I went from loving my day job to loving the company," Swan told Fortt. "The second thing: I was asked."

Shareholders will be watching for Swan to continue diversifying Intel's portfolio outside of the PC.

The appointment marks Intel's seventh CEO in 50 years. Krzanich resigned as CEO and from the board in June.

Todd Underwood, currently vice president of finance, will take over as interim CFO while the company searches for a permanent CFO.

Swan told CNBC last week that the board would take its time making a selection.

"Our input to the board is, take the time necessary to get somebody great and in the meantime we have a wonderful management team and 107,000 committed employees that are extremely focused on delivering for our customers," Swan said then. "So we're going to be just fine in the interim but I do expect and hope that in the near term, I don't want to put a time frame on it, but on the near term, we'll have a wonderful new CEO."

CNBC's David Faber reported Thursday that Intel was "far down the road" to name another candidate as CEO, but the selection didn't work out. Swan never thought he was in the running and was offered the permanent position after the company's earnings report last week, and after the other candidate fell through, Faber reported.

Analysts and media outlets speculated early on about about several external candidates, including two female executives who had left Intel relatively recently: former data center group head Diane Bryant and former president Renee James. Bryant's successor, executive vice president Navin Shenoy, was also thought to be a contender, along with Lisa Su, CEO of Intel rival AMD, and Sanjay Jha, who stepped down as CEO of chip manufacturer GlobalFoundries earlier this year.

The New York Times reported that Intel product executive Venkata Renduchintala was under consideration. Axios and The New York Times also reported that Apple's senior vice president of hardware technologies, Johny Srouji was also looked at for the job.

"The search committee conducted a comprehensive evaluation of a wide range of internal and external candidates to identify the right leader at this critical juncture in Intel's evolution. We considered many outstanding executives and we concluded the best choice is Bob," Board Chairman Andy Bryant said in a statement. "Important in the board's decision was the outstanding job Bob did as interim CEO for the past seven months, as reflected in Intel's outstanding results in 2018."

Intel last week reported fourth quarter results beat expectations on earnings but fell short on revenue.

Under Krzanich, who took over from Paul Otellini in May 2013, Intel shrunk the percentage of revenue focused on PCs by 12 percentage points. At the same time, it raised the mix of revenue from data center products by 11 percentage points, filings show.

The company also acquired companies with an eye toward diversifying, including artificial intelligence chip company Nervana, programmable chip company Altera and car chip company Mobileye. Krzanich's Intel explored wearables with the help of acquisitions like fitness watch maker Basis Science but ultimately ended up moving away from wearables and closed its New Devices Group.

Swan said in an email to employees Thursday that the company will continue to evolve "from a PC-centric to a data-centric company."

—CNBC's Lauren Feiner contributed to this report.

WATCH: Intel's interim CEO: The shutdown and the US-China trade war curtail consumer and business spending