After giving up on its long-running effort to oust the Lafayette lawyer administering its multibillion-dollar oil spill settlement program, BP decided early this spring to try a different tack: burying the hatchet.

Soon, BP’s chief executive officer, Bob Dudley, traveled to New Orleans to sit down with that lawyer, Patrick Juneau, and try to clear the air.

Over drinks downtown, Juneau said in an interview, the men “reset the button.”

Juneau told Dudley “what I thought about the past, what could be done to make things smoother, more efficient, and address issues that they had.”

The meeting proved to be the turning point in unsticking long-stalled settlement talks among BP, the federal government and five Gulf Coast states that had been tied up in litigation over the 2010 Deepwater Horizon disaster that caused millions of barrels of oil to spew into the Gulf of Mexico.

The face-to-face meeting set the road map for the record $18.7 billion deal that was unveiled July 2, according to interviews with Juneau and other lawyers involved in the process.

The tentative deal, still awaiting a federal judge’s approval, will direct $6.8 billion to Louisiana — the largest amount for any of the five states. The money will go largely toward coastal restoration and repairing the oil spill’s damage to wetlands and wildlife habitats.

Apart from that, the settlement allocates up to $1 billion to resolve claims for economic losses filed by local governments across the region, including those in Louisiana.

After about an hour of chatting with Dudley, Juneau steered the discussion to the possibility of brokering a global settlement that would resolve BP’s largest remaining legal exposure from the disaster: the federal and state claims for economic and environmental damages, plus the hundreds of local government lawsuits.

“I’ve been around this federal court system for a long time,” Juneau said. “As a matter of course, things like this should be addressed in a calm, rational setting.”

Two others joined them for drinks: U.S. Magistrate Judge Sally Shushan, who oversees some aspects of the federal oil spill litigation, and former FBI Director Louis Freeh, who had previously been tapped to investigate allegations of wrongdoing in the claims process.

As the effort gained momentum, U.S. District Judge Carl Barbier, who is overseeing the oil spill litigation, gave Juneau, Freeh and Shushan the go-ahead to determine if a resolution was within reach.

Juneau, a former president of the Louisiana Association of Defense Counsel, has mediated high-profile cases, including liability litigation against the manufacturers of the heartburn drug Propulsid and the painkiller Vioxx and lawsuits against Toyota over the sudden acceleration of its vehicles.

In this case, he said, he would have initially pegged the odds of a negotiated settlement at 5 percent.

“I’ve done over 3,000 mediations as a mediator, so I’ve been in some big ones, but I’ve never been in anything like this,” Juneau said last week, four months after meeting Dudley.

Time was running out

Although earlier settlement talks had gone nowhere, BP likely figured that its time to cut a deal was running out.

Legal experts expected that Barbier would soon rule on how much BP would be on the hook for in federal Clean Water Act penalties because of its leading role in the disaster.

Already years in the making, that decision would have been based on two previous findings that raised the possibility of a multibillion-dollar fine against the company.

This time around, having the head of the oil giant on his home turf led Juneau to believe that the company was ready to come to the table.

After years of being attacked by BP in court filings and in the media, Juneau last week praised the company’s recent turnaround, saying it “stepped up to the plate here, in terms of dealing with the problem. That’s a long departure from where we were three years ago.”

Altogether, the record deal came together after about two months of negotiations, which typically lasted 10 hours a day, including weekends. Entire floors worth of conference space were needed in at least one downtown hotel to accommodate the large group involved.

And the talks stretched on until the night before the deal was unveiled.

So far, the settlement’s specific terms have been kept largely under wraps; participants agreed to nondisclosure agreements that remain in place. But interviews with Juneau as well as a handful of lawyers involved in the process provide a glimpse into how the pact became a reality, and the rapid pace at which the negotiations evolved.

Not long after that initial meeting, BP dispatched its chief financial officer, Brian Gilvary, to begin working on the parameters of the settlement.

Even then, state officials viewed the negotiations cautiously, according to several attorneys involved. A deal might be possible, the thinking went, but remembering the failure of earlier talks, they wondered: Was BP serious this time?

“With the civil judgment pending, we knew that this was another possible window,” said Kyle Graham, executive director of the state Coastal Protection and Restoration Authority. “It just became a question of how real were the discussions going to be.”

Knowing Barbier was close to issuing his ruling set a looming deadline. Everyone knew that any payout ordered by the court was likely to get held up in years of future appeals, whereas this settlement would begin paying dividends quickly.

A manageable schedule

As each side initially drew up priorities for a deal, they were “as far as the Atlantic Ocean — real far — apart,” Juneau said.

In the litigation’s first phase, Barbier ruled that BP’s conduct ahead of the 2010 accident was “reckless,” which, under the federal Clean Water Act, opened the company up to elevated penalties of up to $4,300 for each barrel of oil that spilled — potentially as much as $13.7 billion.

Most legal experts who have followed the legal fallout from the spill did not expect the oil giant to get hit with the maximum penalty. But they surmised that the potential of such a large fine probably led BP to decide to settle rather than leave the question in Barbier’s hands.

Under the settlement, the company will have 15 to 18 years to make most of its payments, at an average rate of about $1.1 billion a year. It will bring BP’s total price tag for the spill to more than $50 billion, including $14 billion that the oil giant spent on response and cleanup and $5.2 billion on Juneau’s settlement program for compensating businesses that suffered losses.

For BP, a key aspect was setting a manageable payout schedule for the deal. That was “crucial,” according to Juneau.

“You and I can cut a deal, but if it ain’t going to work, why do the deal?” he said. “We were trying to put all those pieces of the puzzle together within the confines of BP’s financial capabilities.”

For Louisiana, determining how much money would flow from environmental damage claims — the largest chunk of money the state was in line to get — was the first priority, because those proceeds would steer much-needed resources into coastal restoration.

The two months of negotiations were largely civil, Juneau said. Still — given that each of the five states was trying to justify its piece of the proceeds — at times, tensions emerged over different views of the extent of a state’s losses and damages.

Juneau’s message to them: “Leave all your laundry outside the room and come in here. Let’s just have a frank discussion and try to get what we all think is something that’s feasible, doable, payable and with excellent results for the Gulf Coast region.”

Under the settlement, Florida will get $3.25 billion; Alabama, $2.3 billion; Mississippi, $2.2 billion; and Texas, $788 million. Some of the money isn’t assigned to a particular state.

But for the most part, Louisiana officials didn’t seem to be hung up on what the other states were in line to get, as long as the Pelican State’s piece was large enough. “If you get enough for yourself, you don’t care what your sister gets,” remarked one lawyer familiar with the state’s approach.

Louisiana Attorney General Buddy Caldwell’s office declined comment last week, citing the pending litigation.

A BP spokesman in Houston also declined comment.

‘Their eyes opened’

If the deal is approved in the coming weeks, the money headed to the local governments could come within months in lump-sum payments that local officials could then use at their discretion.

Walter Leger Jr., a New Orleans lawyer who was involved in the negotiations and represents more than 40 local governments in their claims against BP, said parish officials have been just as interested in the much larger chunk of money that will be directed to coastal restoration and repairing wetlands and damaged wildlife habitats.

“When I was able to tell them the whole picture, universally, their eyes opened,” Leger said, adding that some officials were “as excited about the funding that they would not get directly but that would go toward immediately and over the long term attacking the wetlands issues.”

Leaders of local parishes, communities and other government bodies have been discussing and voting on the individual settlement terms last week and this coming week, and BP will have a chance to give the deal a final up-or-down once those results are in.

More than $200 million in settlements was approved last week in the metro New Orleans area. But a few places are holding out, choosing instead to bring lawsuits on their own. They include Plaquemines Parish and the town of Jean Lafitte in Jefferson Parish, where officials said the still-undisclosed proposed payments would not fairly compensate them for the spill’s toll on property and resources.

Though he believes it’s a fair deal overall, Juneau doesn’t fault Plaquemines or anywhere else for opting out.

“This is a good thing; we were a firm believer on that, but I don’t fault anybody for disagreeing,” he said.

Now, as those approvals or rejections roll in over the coming days, BP will have final chance to accept or kill the deal before its fate is left up to Barbier.

“My job was to put it on the table,” Juneau said. “We served dinner. Let’s see if people want to eat what’s been served, and then BP has to make the decision.”

Follow Richard Thompson on Twitter, @rthompsonMSY.