Oracle co-Chief Executive Mark Hurd, who led two Silicon Valley giants even as he weathered a scandal over his relationship with a former reality-TV star, has died at 62.

Oracle confirmed his death Friday, but gave no cause. Hurd had been on medical leave, which Oracle announced in September.

During his career, Hurd ran both Oracle and computer and printer maker Hewlett-Packard. Hurd joined Oracle as a co-president in 2010, a month after leaving HP.

He had resigned from HP following a scandal that rocked the company when Jodie Fisher, a former reality-TV star who worked as a greeter at HP events, accused him of trying to badger her into entering a sexual relationship.

Hurd reportedly made numerous advances toward Fisher, who had posed semi-nude in Playboy during her college years and acted in several soft-core skin flicks.

In that pre-#MeToo era, Hurd’s departure from HP was a significant Silicon Valley drama. An investigation found while Hurd didn’t violate sexual harassment policies, he submitted inaccurate expense reports connected to outings with Fisher. Hurd said he didn’t try to conceal his dinners with Fisher after events she helped organize.

Hurd forked over more than $1 million of his personal fortune to keep the sordid details under wraps, The Post reported at the time. HP directors were also disturbed by Fisher’s allegations that Hurd, during the time they worked closely together, had divulged information to her that she could have used to profit from trading in HP shares.

HP’s stock price more than doubled during Hurd’s five-year stint as CEO, adding about $50 billion to the company’s market value.

During the scandal, Oracle Chairman Larry Ellison came to Hurd’s defense, railing against HP for disclosing the harassment claim, calling it “cowardly corporate political correctness.”

He called ousting Hurd the worst personnel decision since Apple had ousted Steve Jobs a quarter-century earlier.

In a note to Oracle employees, Ellison said he would miss Hurd, whom he termed a close and irreplaceable friend.

In the official notice of Hurd’s medical leave a month earlier, Ellison said that Hurd had requested an absence “to address some health-related issues and we all wish him a speedy recovery.”