At least part of the proceeds will go toward a $20 billion fund that BP agreed to last month under pressure from the Obama administration. The fund will help pay cleanup costs and damages from the spill.
As the spill escalated in the weeks after the explosion of the Deepwater Horizon rig, BP realized it would need to boost its cash reserves to pay costs that analysts have said could rise to $100 billion. The company suspended dividend payments of about $10.6 billion for this year, and sped up plans to sell $10 billion in assets.
Apache eventually emerged as a potential buyer.
"If it hadn't been for the Gulf incident, I'm sure we wouldn't be sitting here tonight," Apache Chief Executive G. Steven Farris told investors after announcing the deal.
BP has spent about $4 billion so far on containing and cleaning up the oil, as well as on damage claims from Gulf businesses. But that's just the beginning. The Gulf spill could be one of the worst environmental disasters in US history and the rig explosion killed 11 workers. Analysts expect BP to be paying fines, damages, legal costs and other expenses for years.
BP has asked its partners in the blown-out well -- Anadarko Petroleum Corp and MOEX 2007 LLC -- to contribute their share of the cleanup costs, but both companies so far have refused.
As part of its agreement with the Obama administration, BP will contribute $5 billion to the oil spill fund this year. The deal with Apache, which includes a $5 billion deposit due July 30, will help cover that contribution.
Earlier Tuesday, BP announced plans to sell its oil and gas fields in Vietnam and Pakistan that analysts value at between $2 billion and $4 billion.
"BP's board believes that there are opportunities to divest assets which are strategically more valuable to other parties than they are to BP," BP Chairman Carl-Henric Svanberg said in a statement.
The asset sales to Apache include:
--Oil fields and gas processing plants in Texas and southeast New Mexico worth $3.1 billion;
--BP's upstream Western Canadian gas business for $3.25 billion;
--Oil exploration and production assets in Egypt worth about $650 million.
BP earned $166 million last year from those properties. They're considered to be past their peak, but that spells opportunity for Apache, which has a reputation for buying mature fields and boosting their production, said Argus Research analyst Phil Weiss.
After the deal was announced, BP shares rose almost 3 percent in after-hours trading while Apache shares dropped about 3 percent. Apache announced separately that earnings nearly doubled in the second quarter to $860.2 million, or $2.53 a share and that it plans to sell 21 million common shares and $1.1 billion of preferred shares to the public.
Farris and Apache made what now seems an ill-timed advance into deepwater drilling just days before the rig explosion. It agreed to buy Mariner Energy Inc and Devon Energy's offshore assets for a combined $3.75 billion. That made Apache a major player in the Gulf of Mexico just weeks before the US banned deep-sea exploration in federal waters.
Apache shares have dropped 16 percent since the April 20 rig explosion. BP's shares have dropped 41 percent in that time.
Apache is one of the biggest of the "independent" petroleum producers, companies that hunt for oil but do not refine it into gasoline and other products.
The sale doesn't include BP's stake in Prudhoe Bay, countering published reports that said a deal with Apache for the Alaska field was in the works.
The companies must wait for government and regulatory approvals to complete the sales. BP said it expects the deals to be completed during the third quarter.