The deal includes its 527 fuel convenience sites and 16 development sites.
Woolworths chief executive Brad Banducci said customers could get cheaper petrol and food.
The deal will also extend the Woolworths Rewards program and reward customers for loyalty and support.
The two new partners have also agreed to develop a new convenience food offer called Metro at BP, which will draw on the Simply Food convenience store joint venture in the United Kingdom with Marks & Spencer.
The Australian Competition and Consumer Commission and the Foreign Investment Review Board need to approve of the deal.
Filling your tank at a BP service station next year may provide the option of earning Qantas or Virgin Australia frequent flyer points at the pump, following BP's $1.8 billion purchase of the Woolworths/Caltex chain.
What's to come with Anthony Lynn as interim coach?
The Ryan might be done in National Football League head coaching circles, but there's a chance that Lynn is just getting started. Receiver Sammy Watkins also supported Ryan by saying he believed the team had the staff and players in place to be a contender.
The two companies have forged a long-term partnership wherein they will continue the 4 cents per litre (cpl) fuel discount for a period of at least 10 years through equal funding.
"For our shareholders, once the strategic partnership is established, it will result in Woolworths having a larger platform for our redemption and reward program, as well as providing us with a unique opportunity to partner with and draw on BP's success in rolling out market-leading convenience food offers globally", he says. Caltex chief executive officer Julian Segal said in a statement that while the Sydney-based refiner and distributor is "disappointed that the successful fuel alliance will come to an end, it is important that we exercise financial discipline in pursuing growth".
While the deal is expected to close not earlier than 2 January, 2018, it is subject to customary terms and conditions. BP also supplies fuel and branding to a further 1,000 sites owned by independent business partners.
"Globally we have developed a winning retail formula where we partner with strong local brands, like Marks & Spencer in the United Kingdom, to provide our customers with a convenience retail offer that meets the needs of their busy lifestyles".
Woolworths knocked back an offer from Caltex to buy their service stations.