The Environmental Protection Agency and BP have reached an agreement that lifts a ban on BP’s ability to hold government contracts that has barred the company from bidding on oil and gas leases on federal lands and waters because of the massive oil spill triggered by a blowout on a BP well in April 2010.

BP, the largest lease-holder and one of the largest oil producers in the Gulf of Mexico, had been pressing for an end to its debarment in order to conduct business more freely and to reassure shareholders that the company could move beyond the accident at its Macondo well. The accident killed 11 workers, sank the half-billion-dollar Deepwater Horizon drilling rig, and spilled as much as 4.2 million barrels into the gulf.

“This was an important milestone,” said Pavel Molchanov, energy analyst at the investment firm Raymond James. “There was some symbolism to this. But it goes beyond symbolism to substantive things, like getting new acreage in the Gulf of Mexico. That is valuable to the company.”

The London-based oil giant filed a lawsuit in a Texas federal court last August, asserting that it had been punished enough and that it was doing its best to make amends for the April 2010 spill.

In December, the British government took the unusual step of filing a brief,which said that the EPA’s prohibition “may have been excessive” and that it “could undermine the corporate culture of responsibility all responsible governments have sought to foster.” It added that the EPA’s suspension was “designed to be a temporary measure, lasting only until ‘the condition giving rise to [an underlying Clean Water Act] conviction has been corrected.’ ”

The EPA first suspended BP from new federal contracts on Nov. 28, 2012, citing its “lack of business integrity.” After BP pleaded guilty to criminal charges in a $4.5 billion settlement with the Justice Department, the EPA extended its ban. On Nov. 26, the agency again extended its ban on BP and 25 of its subsidiaries.

The five-year agreement announced Thursday requires BP to retain an independent auditor approved by the EPA who will conduct an annual review of BP’s compliance with a set of safety, ethics and corporate governance guidelines. The EPA said the agreement gives it the authority to “take appropriate corrective action in the event the agreement is breached.”

The suspension did not affect BP’s existing agreements with the government, and BP said it has invested $50 billion throughout the United States over the past five years.

But the agreement Thursday allows BP to add to its extensive lease holdings. In addition, BP can now bid on military fuel-supply contracts; previously the company was one of the U.S. military’s leading suppliers of fuel.

“After a lengthy negotiation, BP is pleased to have reached this resolution, which we believe to be fair and reasonable,” John Mingé, president of BP America, said in a prepared statement. “Today’s agreement will allow America’s largest energy investor to compete again for federal contracts and leases.”

Public Citizen, however, said the end of the EPA’s ban was “premature.” In a statement, Tyson Slocum, director of Public Citizen’s energy program, said the “announcement lets a corporate felon and repeat offender off the hook for its crimes against people and the environment.” He said BP, which had a string of accidents before the spill, including an Alaskan pipeline leak and a Texas City, Tex., refinery explosion, had failed to demonstrate that its corporate culture had changed.

BP currently has 10 rigs operating in the deepwater areas of the Gulf of Mexico, more than it has ever had, according to company spokesman Brett Clanton. The rigs are engaged in exploration, appraisal and completion projects. The company also owns about 620 lease blocks in the deepwater Gulf of Mexico, more than any other company.

BP produced 189,000 barrels a day of oil and natural gas in 2013 in the deepwater gulf.

BP has said earlier that it plans to invest at least $4 billion a year on exploration in the gulf.

Yet nearly four years after the spill, and after tens of billions of dollars in payments by BP, the British oil giant is still fighting legal battles over Clean Water Act fines and settlements with individuals and businesses in the gulf region. BP expects those fines to cost it $3.5 billion, but the law permits fines that could rise as high as $18 billion.

The company is also locked in a battle with a wide variety of plaintiffs over the implementation of a settlement that was designed to compensate people and businesses in the gulf states for economic damages from the spill.

“There is a certain symbolism to getting this particular legal overhang removed,” said Molchanov, “and there have been lots of legal overhangs for BP over the past four years.”