But neither Mr. Kerry nor Mr. García-Margallo said exactly how much contaminated soil would be sent back, where it would be stored in the United States, or who would pay for the cleanup — some of the issues that have held up a deal until now.

About 5,000 barrels of contaminated earth were shipped to South Carolina from Palomares after the 1966 accident. The United States also provided financial compensation to the region.

But in more recent years, Spanish radioactivity studies found that the initial clearance work had been insufficient, and the Spanish government decided to appropriate the land around Palomares to ensure that it would not be used for real estate projects. A main concern has been that the remaining plutonium was being allowed to degenerate into other radioactive components like americium, which emits gamma rays that travel farther and are hard to block. Spain has insisted that any contaminated soil be sent to the United States, because Spain does not have plants to store it.

Spain said in 2011 that clearing Palomares properly was a priority. An American scientific delegation visited Palomares that year, but no agreement was reached amid worries over what precedent such a deal could set for other countries pursuing similar claims with the United States.

The relationship between the two countries has been bolstered recently as Washington seeks to raise its military presence in Spain, even as it has made cuts at other bases around Europe. The Navy recently sent four destroyers to Rota, in southern Spain, strengthening a hub for operations in the Mediterranean. In May, the two countries also agreed that another military site, at Morón de la Frontera, would become a permanent American Marine base, which could accommodate nearly 3,000 troops as part of a rapid-reaction force that can be deployed primarily in Africa.