TOKYO – Japan on Friday passed a law bolstering its anti-piracy mission in the Gulf of Aden, despite criticism from the opposition that the move further erodes the country's pacifist constitution.

Somali gangs have made millions of dollars by hijacking vessels in the Gulf and the Indian Ocean, driving up insurance costs, a headache for resource-poor Japan, which imports 80 percent of its oil from the Middle East.

Japan has two naval destroyers escorting Japan-related ships in the area, where more than a dozen nations are helping in a policing operation. It has also stationed two intelligence-gathering aircraft in Djibouti.

The new law will enable its forces to escort ships that have no connection with Japan, though they have already stretched their remit by aiding foreign vessels, domestic media reports say. The government had feared international criticism if Japan did not assist other countries' vessels.

The legislation also relaxes the rules on when Japan's troops may open fire on a suspected pirate vessel, a sensitive issue in Japan, where overseas military activity is tightly controlled under the pacifist constitution.

The main opposition Democratic Party of Japan, whom polls show have a chance at taking power in an upcoming election, had called for restrictions to be added to the bill, but they were rejected by the ruling Liberal Democratic Party (LDP), Kyodo news agency said. Smaller opposition parties had opposed the law.

U.S. and United Nations officials said last month the international maritime crackdown on piracy was showing signs of success.

(Reporting by Isabel Reynolds; Editing by Joseph Radford)