LONDON — The British oil company BP said Monday that a partner in the well that exploded last year in the Gulf of Mexico, Anadarko Petroleum, had agreed to pay $4 billion to settle claims related to the ensuing oil spill.

The settlement ends a long dispute between BP, which operated the well in the gulf, and Anadarko, which had a 25 percent stake, about accepting responsibility for compensating those affected by one of the worst oil spills in the United States.

The settlement was not an admission of liability, said BP, whose investigation concluded that the accident was the result of multiple miscues involving several companies. BP continues to quarrel with its contractors, Transocean, which operated the rig, and Halliburton, which was responsible for cement work, about participating in the compensation payments. BP said Monday that the Anadarko settlement should set an example for the two contractors.

“There is clear progress with parties stepping forward to meet their obligations and help fund the economic and environmental restoration of the gulf,” said the chief executive of BP, Robert W. Dudley. “It’s time for the contractors, including Transocean and Halliburton, to do the same.”