The Supreme Court of the Philippines has declared, in a 10-4 ruling, a security deal with the US to be constitutional.
Tuesday's decision, announced amid protests outside the country against the agreement, will allow an increased presence in the Philippines, a former US colony, against a backdrop of escalating tensions in the South China Sea.
Signed two years ago, the Enhanced Defence Cooperation Agreement, or EDCA, will allow the US to build structures, station troops and store weapons in the Philippines, as well as allow broad access to Philippine military bases.
Petitioners have argued that the deal surrenders national sovereignty to a foreign power.
They also argued that it is a treaty, not a mere supplement to an existing agreement.
Therefore, it would require the concurrence of the Senate rather than just an executive nod.
'Pivot to Asia'
The Supreme Court decision will now allow further details to be hammered out between the Philippine and US governments.
The Philippines has long been a staunch US ally and supporters say the deal is important for both sides as the country confronts China in the disputed Spratly archipelago and the US launches a "pivot" back to Asia.
Al Jazeera's Marga Ortigas, reporting from Manila, said those protesting against the decision worry the move may provoke China, and that the brunt of this conflict into which the US has inserted itself will be felt in the Philippines.
Activists outside the court said the ruling was "untenable" because the deal was a de-facto basing agreement and would make the country "a launching pad for military intervention in the region".
Philippine military officials say there has been an increase in US exercises, training and ship and aircraft visits in the past year under Obama's rebalance to Asia but this pact will take the relationship a step further.
China claims almost all the South China Sea, which is believed to have huge deposits of oil and gas, and has been building up facilities on islands it controls.
Brunei, Malaysia, Vietnam, Taiwan and the Philippines also have claims.
Tension rose this month when China began test flights on Fiery Cross Reef, one of three artificial islands where China has constructed airfields.
Source: Al Jazeera and agencies