TOKYO - Japan's next ruling party agreed Wednesday to form a coalition with two smaller parties, one of which wants to move a U.S. Marine base off of Okinawa and review an agreement that stations 50,000 American forces in the country.

The Democratic Party of Japan swept to victory in recent elections for parliament's powerful lower house, but needed help to ensure it could pass legislation smoothly in the upper house. The coalition agreement paves the way for the Democrats' chief Yukio Hatoyama to put together a new Cabinet.

Parliament is expected to formally elect Hatoyama prime minister on Sept. 16.

"We are at the starting line for a new government," Hatoyama said after signing the agreement.

His party will align with the Social Democratic Party and the People's New Party to replace the outgoing Liberal Democrats, a pro-big business and staunchly pro-U.S. party that had governed the country for more than 50 years.

The new government could cause concern abroad. Already Hatoyama's declarations that he wants to forge a new, more independent relationship with the U.S. -- a key trade partner and the Asian power's strongest ally -- have been met with uneasiness. He has reassured Washington and voters that the alliance will remain the cornerstone of Tokyo's foreign policy, but wants to put it on a more equal footing.

A likely first test of this new path will be the fate of a U.S. airfield on the southern island of Okinawa, home to about 18,000 American Marines.

As part of a broad realignment of U.S. troops in Asia, Washington and the outgoing Liberal Democrats agreed years ago to close the airfield in the crowded city of Futenma and find a new location for it elsewhere on the island.

That plan would also move 8,000 Marines from Okinawa to the U.S. Pacific territory of Guam by 2014. The rest would remain.

Washington says the deal cannot be renegotiated, but while in the opposition, the Democratic Party had criticized the plan, saying the base should be built somewhere else in Japan and balking at the cost of transferring the Marines to Guam. Under the deal, Japan has pledged to contribute $6 billion toward the move.

Since winning the elections, the Democrats have toned down their rhetoric and have appeared more willing to work with Washington to fulfil the pact. The New People's Party, which is the smallest and most conservative member of the coalition, is more concerned with domestic issues than foreign affairs. But the pacifist Social Democrats are less likely to fall in line.

The Social Democrats want the airfield be relocated outside of Japan. Further, they want to re-examine the overall security alliance under which the 50,000 U.S. troops are stationed here.

"We didn't agree on everything, but we made progress," said Yasumasa Shigeno, the party's secretary general.

The pressure from the Social Democrats on the base issue has put Hatoyama in a complex position.

Takehiko Yamamoto, an international politics professor at Tokyo's Waseda University, said the issue could be a "destabilizing factor" for the coalition.

"It's a major test for Mr. Hatoyama's leadership," he said.

But he said Hatoyama is not likely to sacrifice Japan-U.S. relations with a major change on the U.S. troop agreement.

"Such accords are not supposed to be revised easily, and if the Democrats really push to renegotiate, that could invite distrust of Japan in Washington," he said.