ATLANTA — The United States, Japan and 10 other Pacific Rim nations on Monday reached final agreement on the largest regional trade accord in history, teeing up what could be the toughest fight President Obama will face in his final year in office: securing approval from Congress.

The conclusion of the Trans-Pacific Partnership, after years of negotiations and a series of sleepless nights here, was merely “an important first step,” conceded Michael B. Froman, the United States trade representative, as he and other weary officials announced their accord.

Now the deal faces months of scrutiny in Congress, where some bipartisan opposition was immediate. That debate will unfurl against the backdrop of a presidential campaign in which populist anti-trade talk against the deal is already prominent.

Still, for Mr. Obama the accord could be a legacy-making achievement, drawing together countries representing two-fifths of the global economy, from Canada and Chile to Japan and Australia, into a web of common rules governing trans-Pacific commerce. It is the capstone both of his economic agenda to expand exports and of his foreign policy “rebalance” toward closer relations with fast-growing eastern Asia, after years of American preoccupation with the Middle East and North Africa.