A handful of major industries scored big wins in President Trump’s North American trade agreement — at times at the expense of ordinary consumers in the United States, Canada and Mexico.

The winners include oil companies, technology firms and retailers, but chief among them are pharmaceutical companies, which gained guarantees against competition from cheaper generic drugs.

The gains underscore the benefits U.S. industry will be seeking, and the pressure it will exert, as the Trump administration continues rewriting trade deals with other countries and regions.

Lobbyists for several industries said they hoped the U.S.-Mexico-Canada Agreement, or USMCA, would serve as a yardstick for future U.S. trade deals, including any involving China.

The pharmaceutical industry won stronger protection for sales of so-called biologic drugs, which are typically derived from living organisms and are administered by injection or infusion. The medicines are among the most costly and innovative on the market and are a major driver of drug spending.

USMCA guards new biologic drugs from cheaper generic competition for “at least ten years,” compared with current protection of eight years in Canada and five years in Mexico.

“By increasing the term to 10 years, there will be less competition and higher prices,” said Valeria Moy, an economics professor and the director of Mexico Como Vamos, a think tank in Mexico City. “Having more protection in that area means higher prices for consumers.”

The agreement provides extra protection to drug companies in the much larger U.S. market, as well. Current U.S. law protects biologic drugs from generic competition for 12 years, but some Democrats, including in the Obama administration, have pushed to lower that to seven years as a way to speed cheaper generics to the market and lower drug spending.

Critics of the trade agreement argued that by setting a minimum of 10 years of protection, the trilateral pact shields the pharmaceutical industry from future legislative attempts in the United States to shorten biologic drug monopolies.

It “decreases U.S. sovereignty,” said Jeff Francer, general counsel for the Association for Accessible Medicines, a lobbying group for generic drugmakers. “It would be much harder for Congress to try to roll back 12 years to seven years if we’re enshrining 10 years in a free-trade agreement.”

Celeste Drake, a trade policy specialist at the AFL-CIO labor federation, criticized the provision for restricting future action by U.S. lawmakers, and for impeding Mexico’s and Canada’s health-care systems. “This is not appropriate for a trade agreement. We think every country in the world should be able to decide as a democratic society what their rules are going to be with respect to medicine,” she said.

PhRMA, the pharmaceutical industry lobby, said in an emailed statement that a big aim of agreements like USMCA is “to raise global standards, including for intellectual property, among our trading partners, leveling the playing field for American innovators and manufacturers.”

It added: “Nothing in this agreement changes U.S. law as it relates to our industry. That’s not the intent of international trade deals nor anything we’ve sought in any U.S. trade agreement.”

In his Rose Garden speech outlining the deal this week, Trump said USMCA would “make North America a haven for medical innovation and development.”

“We want our drugs to be made here. When you talk prescription drugs, we don’t like getting them from foreign countries,” he said.

Trump has long said his goal in revamping the North American Free Trade Agreement was to return lost manufacturing jobs to American shores, discourage future outsourcing of factory work and “send cash and jobs pouring into the United States.”

The leaders of all three nations are preparing to sign the agreement before the end of November — possibly at the Group of 20 summit in Buenos Aires, according to Mexican officials. But Congress and the legislatures in Canada and Mexico must still approve the deal.

Technology and retail companies also won protections in the new deal that they hope Washington will vigorously pursue with China, where many U.S. industries have complained of unfair treatment.

Josh Kallmer, executive vice president for policy at the Information Technology Industry Council, said the USMCA provisions are important not so much because of business risks in Mexico or Canada, but because any trade agreement is “a powerful way to steer the conversation globally.”

“More skeptical governments,” including China, could eventually “warm up to” the same rules by seeing them encoded in deals such as USMCA, Kallmer said.

The agreement largely prohibits restrictions on the flow of business-related data across borders and prohibits countries from requiring companies to locate their data storage or computing infrastructure within the borders of that country.

Beijing has at times restricted data transfer across China’s borders and required foreign companies to store data in China as a condition of doing business in the country — both measures that have hurt U.S. tech companies, Kallmer said.

Jonathan Gold of the National Retail Federation said the retail industry also lobbied for the data-transfer provisions. “Digital trade didn’t exist back when NAFTA was first negotiated,” he said. “Considering this is going to be a road map for other free-trade agreements it’s important to have the language in there.”

For the U.S. oil industry, which was worried that Mexico’s incoming president, Andrés Manuel López Obrador, will treat foreign investors unfavorably in the energy sector, the deal provided new assurances.

López Obrador has at times criticized the foreign investment that has poured into Mexico after the country began allowing foreign companies to invest in oil exploration and production in 2013.

He has not offered much clarity on whether he will strike new deals with foreign companies but has said he intends to respect the more than 100 contracts already signed with companies including ExxonMobil, Chevron and BP.

Thanks to lobbying by the energy industry, USMCA allows oil and a few other industries to continue using a special dispute-resolution process from the original NAFTA agreement in their dealings with the Mexican government.

That process allows companies to seek an international arbitration ruling outside Mexico’s court system if they have an investment dispute with the Mexican government.

Aaron Padilla, senior adviser for international policy at the American Petroleum Institute lobbying group, said companies pushed for the arbitration clause because they are investing big sums over many years in offshore oil projects and want to be sure they have some protection from changing politics.

“The new president in Mexico has expressed some skepticism about energy reforms he has inherited from his predecessor,” he said. “Our member companies are looking to work constructively with him, but they are looking at the long term and understand politics can change in any country.”

Mexican investors in certain sectors in the United States will also be allowed to use this international arbitration process. Canada opted out of the provision. The old NAFTA deal allowed investors in all three countries to seek international arbitration during disputes with governments.

Joshua Partlow in Mexico City and Selena Ross in Ottawa contributed to this report.