MANILA, Philippines - A new defense pact that will allow thousands of U.S. troops to be temporarily based in Philippines for the first time in more than 20 years signals closer cooperation in the allies' hot-and-cold relationship that has been shaped over the decades by war, terrorism and now, jitters over China's rise.

The 10-year agreement, signed Monday as President Obama arrived in Manila, was considered the centerpiece of his four-nation Asian trip, which Obama used to reassure allies like Japan and the Philippines of American military backing as they wrangle with China in increasingly tense territorial disputes.

Obama said the Enhanced Defense Cooperation Agreement showed that Manila and Washington have emerged from a rough period in their alliance.

"We're here in the Philippines signing a defense agreement," he said at a news conference with President Benigno Aquino 3d at the presidential palace. "Ten years ago, 15 years ago, there was enormous tensions around our defense relationship with the Philippines."

The pact will allow thousands of rotating batches of U.S. forces to gain temporary access to mutually chosen Philippine military camps, paving the way for the largest U.S. military deployment in the country since U.S. bases were closed in 1992. It will also allow the United States to station fighter jets, ships, and surveillance equipment in the Philippines on a limited basis.

China's growing military might and assertiveness in the region have helped bring the two nations closer together.

The Philippines has struggled to bolster its territorial defense amid disputes with China, including the Scarborough Shoal, a rich fishing ground off the northwestern Philippines that Beijing took effective control of in 2012. Chinese coast guard ships last year surrounded another contested offshore territory.