Cabinet members and members of Congress applaud as President Obama takes part in a signing ceremony for trade bills at the White House in Washington June 29, 2015. (REUTERS/Kevin Lamarque)

President Obama hailed a "true bipartisan effort" on Monday as he signed a package of trade bills into law, and he called on Washington to summon a similar spirit of compromise to address the nation's crumbling infrastructure.

Obama was joined by seven members of Congress, including two Republicans, during a signing ceremony for the two bills, which will give his administration "fast-track" authority to complete trade accords and provide retraining for workers displaced by trade pacts.

"I thought we'd start off the week with something we should do more often -- a truly bipartisan bill signing," Obama said in the East Room of the White House. "This is... a reminder of what we can get done on even the toughest of issues if we compromise. I hope we can summon that effort on future challenges, including rebuilding our roads and bridges and infrastructure around the country. The American people deserve nothing less from us."

[Obama scores a major trade win, burnishing his foreign policy legacy]

Obama's signature on the legislation caps a laborious and contentious months-long campaign by the president to win the fast-track authority, which will allow his administration to complete the 12-nation Trans-Pacific Partnership (TPP) by year's end. The legislation grants the president the power to present the deal -- and another multi-nation European accord that is not as far along in negotiations -- to Congress for a vote on a specified timetable without lawmakers being able to amend the terms.

Republicans overwhelmingly supported the legislation, but most Democrats, citing fierce opposition from labor unions, opposed it. Many Democrats accused Obama of turning his back on Democratic priorities, including infrastructure and tax reform, which would have allied the president with his own party against the GOP.

[Opinion: The anachronistic trade agreement]

In the signing ceremony, Obama emphasized that his push on trade will help the United States remain economically competitive in a fast-changing global economy and, ultimately, create jobs and raise wages for American workers.

"I would not be doing this, would not be signing these bills, if I was not absolutely convinced that these pieces of legislation are ultimately good for American workers," he said.

Congress is in recess this week, and none of the congressional leadership attended the ceremony. But Obama thanked House Speaker John A. Boehner (R-Ohio) and Senate Majority Leader Mitch McConnell (R-Ky.), along with Sen. Ron Wyden (D-Ore.) and Rep. Paul Ryan (R-Wis.), among others. Those present were Sen. Chris Coons (D-Del.), and Reps. John Delaney (D-Mich.), Ron Kind (D-Wis.), Gerald Connolly (D-Va.), Don Beyer (D-Va.), Pat Tiberi (R-Ohio) and Dave Reichert (R-Wash.)

"This is so much fun, we should do it again," Obama remarked as he signed the bills.

"No, thank you," said Connolly, one of just 28 House Democrats who supported the fast-track bill.

"Well, maybe not this particular piece of legislation," Obama replied. "I do like signing bills, though."