The United States and 11 other nations have come up with a trade deal after years of negotiations. But what's in it, who hates it, and what happens next? (Gillian Brockell/The Washington Post)

President Obama hailed the historic 12-nation Pacific Rim trade deal completed here Monday as an accord that “reflects America’s values,” but within hours the administration had turned from the negotiating table to selling the agreement on Capitol Hill, a reflection of the harsh political climate the controversial pact is expected to face in Congress.

Obama pledged that the ­Trans-Pacific Partnership (TPP), the largest free-trade agreement in a generation, would open new markets for U.S. goods and services and establish rules of international commerce that give “our workers the fair shot at success they deserve.”

But almost immediately there were signs of the tough fight ahead to win final ratification from Congress next year. Lawmakers from both parties criticized the pact as falling short in crucial areas, raising the prospect that the White House could lose the support of allies who had backed the president’s trade push earlier this year.

“Closing a deal is an achievement for our nation only if it works for the American people and can pass Congress by meeting the high-standard objectives laid out” by lawmakers in the spring, said Sen. Orrin G. Hatch (R-Utah), chairman of the Senate Finance Committee. “While the details are still emerging, unfortunately I am afraid this deal appears to fall woefully short.”

Monday’s announcement that trade ministers had reached consensus on the deal, after five days of negotiations, started the clock on the final stages of winning approval from national legislatures. The United States, where the 2016 presidential campaign is underway, is not the only nation where political turbulence could affect completion of the deal.

Protesters in Atlanta stage marches against the Trans-Pacific Partnership trade deal. (Paul Handley/AFP/Getty Images)

Canadian Prime Minister Stephen Harper, who backed the deal, is facing a tough reelection vote this month, and the opposition party has said it would not be bound by the terms of the deal. Leaders of Australia, New Zealand and several other countries made tough compromises that face stiff opposition at home.

On the U.S. campaign trail, Sen. Bernie Sanders (I-Vt.), who is running for the Democratic presidential nomination, slammed the deal, saying that “Wall Street and other big corporations have won again.” Republican front-runner Donald Trump tweeted on Monday: “The incompetence of our current administration is beyond comprehension. TPP is a terrible deal.” And Democrat Hillary Rodham Clinton has hedged on the TPP pact, despite having supported it while serving as Obama’s secretary of state.

“I’ll leave the presidential politics to someone else,” U.S. Trade Representative Michael Froman said during a news conference in Atlanta. “Our job is to reach agreement and explain it fully to the American public. Given where we are in the calendar, this really is a 2016 issue for Congress to consider.”

Obama must wait at least 90 days after notifying Congress of the deal before he can sign it and send it to Capitol Hill, and the full text of the agreement must be made public for at least 60 of those days.

Congress is expected to receive the legal documents to start the 90-day clock later this week. Lawmakers will then have 30 days to review the deal before it is made public.

The next step will be for the U.S. International Trade Commission to conduct a full economic review of the deal. The agency has up to 105 days to complete that work.

Under the terms of “fast track” trade legislation approved by Congress this summer, lawmakers will not be able to amend or filibuster the TPP pact. The only leverage they have is to fully approve the deal or reject it in its entirety. Fast-track also ensures that it takes only a simple majority to pass the deal, but that majority support is far from guaranteed. Obama has battled trade skeptics in both parties this year in his quest to secure the expedited rules. The additional negotiations have done little to sway critics within his party.

Capitol Hill staffers said votes in the House and Senate are not likely to take place before mid-April, at the earliest, and a reshuffling in the House Republican leadership after the announced resignation of Speaker John A. Boehner (R-Ohio) could produce even more uncertainty. While the GOP has been more supportive of Obama’s trade agenda, some conservatives have opposed a pact negotiated by a Democratic White House.

Opponents in Obama’s party, who believe the deal will hurt working-class Americans, have vowed to turn the trade deal into a political issue in an attempt to block it. Only 28 of 188 House Democrats supported the fast-track trade bill in June.

“Froman says this is a 2016 issue. That’s perfect timing because a presidential election year is the best opportunity to shine a light on all the bad trade provisions in this deal,” said Rep. Rosa L. DeLauro (D-Conn.), a fierce critic of the pact. The Obama administration “is supposed to be fighting for the American public, not high-priced lobbyists, but unfortunately this administration’s approach has been the exact opposite.”

The TPP, which has been negotiated for eight years, is a sprawling, 30-chapter accord that addresses tariff reductions for agriculture and automobiles, as well as intellectual-property rights for movies and pharmaceutical drugs, the free flow of information on the Internet, wildlife conservation, online commerce and dispute settlement practices for multinational corporations.

The 12 TPP nations — Australia, Brunei, Canada, Chile, Japan, Malaysia, Mexico, New Zealand, Peru, Singapore, the United States and Vietnam — account for 36 percent of the world’s gross domestic product.

Negotiators meeting here were under mounting pressure to close the gaps on several remaining issues. Efforts to reach final consensus during the last negotiating round in Maui in July broke off after deadlocks over dairy tariffs, rules governing where automobiles are manufactured and market protections for next-generation biologic drugs.

According to U.S. officials, the talks in Atlanta were a marathon that stretched deep into the night and early morning. Plans to announce a deal were postponed several times as negotiators hashed out the technical details, and the language of the text was still being tweaked at 5 a.m. Monday, just hours before the news conference.

But members of Congress warned in the final days that the pressure to close the deal could lead to bad compromises from the U.S. delegation. Hatch is reportedly upset over the terms that would govern how long pharmaceutical companies could maintain market exclusivity on genetically engineered drugs. U.S. law allows 12 years of patent-style protections, but the final agreement is reportedly closer to the five years allowed under Australian law.

“The United States should not settle for a mediocre deal that fails to set high-standard trade rules,” Hatch said.

Other lawmakers hailed separate portions of the agreement, including new labor standards to protect workers and a last-minute provision that would not allow cigarette companies access to a new international dispute settlement panel. Critics of such panels, including Sen. Elizabeth Warren (D-Mass.), have charged that the pact would allow large corporations to sue TPP member nations for lost profits if they changed their public health laws or other regulations.

“It’s now time for Congress and the public to examine the details of the TPP and assess whether it will advance the nation’s interests,” said Sen. Ron Wyden (D-Ore.), a key party supporter of Obama’s trade push.

Officials in Atlanta emphasized that the agreement will pay long-term dividends, deepening multilateral relations in a way that develops common interests and reduces volatility in global markets. The TPP represents the largest U.S. trade pact since the North American Free Trade Agreement with Canada and Mexico in 1993.

Obama aides have called the deal an important part of a foreign policy strategy to maintain an economic edge on China, which has been expanding its influence in Asia. The TPP has been crafted to allow other nations to join if they pledge to meet the standards, and South Korea already has expressed interest.

“Long after details of things like tons of butter sold are regarded as a footnote in history, the bigger picture of what we achieved today will be what remains,” said New Zealand Trade Minister Tim Groser. “Our industry structures will change in response to the opportunities in this agreement. In future years, we will be absolutely certain of the depth of achievement we reached at this point in our collective history.”

Kelsey Snell in Washington contributed to this report.