The technology firm gave no reason for the decision to pull out, stating only that now is the "natural moment for HP to conclude our relationship".
HP will continue as principal sponsor of the team until the completion of this year's season, and will work closely with the team to pursue the best results possible as the season closes in Brazil, Japan and China.
"This has been a successful global branding property and an excellent technology partnership for HP," said Cathy Lyons, executive vice president and chief marketing officer at HP.
Sir Frank Williams, principal of the BMW Williams F1 team, added: "HP has made an important contribution over the past six years, in particular establishing a technology base and IT approach for us which we believe has put us at the forefront of F1 teams in this respect."
HP has been the principal sponsor and technology provider to the BMW Williams F1 team since 2000.
Latest Tesla news: Tesla stock price tanks amid reports of 'widening probe' by SEC and claims the base Model 3 loses money
SEC 'probe' takes its toll on Tesla as new research suggests that Tesla loses $6,000 on every $35,000 Model 3
10nm Cannon Lake Core i3-8121U CPUs make a rare outing with Intel's NUC mini PC
'Notorious' Australian child hacker thought he had executed 'flawless' hack
The former employee says that Tesla fired him for bringing the accusations to management internally