It took two years, but the trouble in Margaritaville has been resolved.

The United States and Mexico signed an agreement Tuesday that will allow continued bulk shipments of tequila from Mexico into the United States.

In 2003, the Mexican government issued a proposal that would have banned bulk shipments and required that all Mexican tequila bound for the United States be bottled in Mexico.

U.S. liquor companies cried foul, saying the proposal was a violation of international trade rules and ran counter to general practices in the liquor industry worldwide. In 2004, 74 percent of the tequila imported into the United States was shipped in bulk form.

The rule never went into effect as negotiations began to resolve the dispute. Under the agreement signed Tuesday, the Mexican government said it would not limit bulk shipments of tequila into the United States.

The agreement was signed in Washington by U.S. Trade Representative Rob Portman and Mexican Economy Secretary Sergio Garcia de Alba.

"We have resolved this important trade challenge in a way that ensures U.S. bottlers will have continued access to bulk tequila," Portman said in a statement.

He said Mexico's proposed ban would have threatened huge investments made by American companies to build bottling plants and develop brand loyalty.

Peter Cressy, president of the Distilled Spirits Council, an American lobbying group, said the deal would "protect the interests of Mexican agave growers and tequila producers as well as U.S. bottlers and importers."

Propelled by the popularity of magaritas and tequila shots chased with lime and salt, tequila is the fastest growing liquor in the United States. The industry said tequila sales volume rose by 8.3 percent in 2004, with retail sales reaching approximately $3.3 billion.

The agreement calls for establishment of a tequila bottlers registry to identify all approved bottlers of tequila in the United States and creation of a working group to monitor implementation of the agreement.