(Reuters) - Before Occidental Petroleum Corp clinched a deal on Thursday to buy Anadarko Petroleum Corp for $38 billion, it pursued its U.S. oil and gas exploration and production rival for nearly two years, culminating in the sector’s most high-profile public contest since the 1980s.

FILE PHOTO: Anadarko Petroleum Corporation is seen in The Woodlands, Texas, U.S., April 30, 2019. REUTERS/Loren Elliott/File Photo

For most of Occidental’s pursuit, Anadarko snubbed its overtures, arguing its offers were too risky. Last month, it entered into a deal with deep-pocketed oil major Chevron Corp to sell itself for $33 billion in cash and stock.

Yet Occidental turned the tables on Chevron by securing a $10 billion investment from Warren Buffett’s Berkshire Hathaway Inc and an $8.8 billion asset sale to France’s Total SA. These deals gave Occidental the firepower to prevail over Chevron in the race for Anadarko.

Here is the inside account of the takeover battle, according to seven sources familiar with the discussions:

SEPTEMBER 2017 - Occidental CEO Vicki Hollub contacted Anadarko CEO Al Walker and proposed to acquire Anadarko for between $60 and $70 per share in an all-stock deal. Occidental’s initial proposal did not detail financing nor mention approval from its board of directors.

OCTOBER 2017 - Hollub followed up with Walker, informing him that she had the approval of her board. Walker said he would take the offer to his board of directors.

NOVEMBER 2017 - Anadarko officially rejected the offer, saying it would not be a good “strategic and operational fit”.

JANUARY 2018 - Occidental made a revised proposal of $76 a share for Anadarko, half in cash and half in stock.

FEBRUARY 2018 - Anadarko responded that Occidental’s offer still carried too much risk, which could only be mitigated with an all-cash offer. The high percentage of stock would require Occidental to hold at least two shareholder votes to get clearance. Discussions ended for the rest of 2018.

FEBRUARY 2019 - Chevron CEO Mike Wirth approached Walker with an offer to acquire Anadarko for 75% stock and 25% cash, for a total value of about $64 a share. Anadarko’s board agreed to open up the company’s books to Chevron.

MARCH 22, 2019 - Chevron and Anadarko were close to signing an agreement when Occidental contacted Anadarko once again.

MARCH 23, 2019 - Occidental sent Anadarko an offer for $19 per share in cash and 0.8737 shares of its stock for a total of about $76 a share. The offer was based on a 75/25 stock-cash split.

MARCH 24, 2019 - Chevron upped its offer by $1 per share to $65 a share with the same 75/25 stock-cash split. Chevron also informed Anadarko it would drop its bid if a deal was not signed soon. Anadarko’s board weighed the two offers and authorized Walker to enter into a non-disclosure agreement with Occidental that would kick off negotiations. Anadarko also closed its books to Chevron.

MARCH 25, 2019 - Due diligence started and resurrected the issues Anadarko and Occidental had previously discussed. Anadarko asked for a ‘collar’ that could shield Occidental’s bid from fluctuations in its share price. Anadarko reiterated concerns about Occidental’s financing arrangements and ability to win two shareholder votes.

APRIL 5, 2019 - While in talks with Occidental, Anadarko checked in with Chevron to gauge interest.

APRIL 8, 2019 - Occidental sent Anadarko a revised offer. The bid was lowered to $72 a share and the terms were changed to 40% cash and 60% stock, which removed one shareholder approval requirement. Occidental justified the lower offer by citing the higher cash component and referring to findings in its due diligence into Anadarko. The new offer still had no collar. Walker took the offer to Anadarko’s board, which rejected it.

APRIL 9, 2019 - Anadarko restarted talks with Chevron. Walker negotiated a lower breakup fee of $1 billion with Chevron, leaving the door open for a rival bid. Anadarko also unsuccessfully asked Chevron to increase its offer.

APRIL 10, 2019 - Anadarko agreed to accept the offer on the table from Chevron.

APRIL 11, 2019 - Hollub sent Walker another email, this time increasing Occidental’s offer back to $76 per share, with a 40/60 cash/stock split, including three board seats. Hollub also assured Walker she could get the deal done quickly. There was no reference in the email to financing, the collar, or the shareholder approval. Hollub offered to get the deal signed as soon as Sunday, April 14. Anadarko’s advisers said that negotiations with Occidental could take two more weeks, jeopardizing a bird in hand that Walker had with Chevron’s offer. Anadarko’s board voted to approve the deal with Chevron.

On the same day, the board also approved higher compensation for Walker should the company change hands, according to an Anadarko filing with the Securities and Exchange Commission.

Chevron and Anadarko signed their merger agreement that evening.

APRIL 12, 2019 - Chevron announced its deal to buy Anadarko, valued at the time at $65 per share.

APRIL 24, 2019 - Occidental announced a new $76-per-share bid for Anadarko, payable half in cash and half in Occidental stock. It said its deal would not contain any financing condition, but would require a vote by Occidental shareholders.

APRIL 29, 2019 - Anadarko said it would negotiate with Occidental over its bid, after determining it could lead to a better deal than it had struck with Chevron.

APRIL 30, 2019 - Buffett’s Berkshire announced a deal to bankroll Occidental’s bid for Anadarko.

MAY 5, 2019 - Occidental clinched an agreement to sell Anadarko’s African assets to Total for $8.8 billion in the event of a deal. Occidental also increased the cash component of its $38 billion bid to acquire Anadarko to 78% from 50%, removing a requirement for any deal to receive the approval of Occidental’s shareholders.

MAY 6, 2019 - Anadarko’s board found Occidental’s bid to be superior, triggering a four-day clock in its contract with Chevron that allowed the latter to match.

MAY 9, 2019 - Chevron abandoned its pursuit of Anadarko, citing price discipline. Occidental declared victory.