"Japan can take action more effectively against piracy, in co-operation with other countries," Taro Aso, Japan's prime minister, said in a statement.
"Piracy is a threat not only to Japan, but to the international community and a challenge Japan should proactively deal with," he said.
The constitutionally pacifist nation joined the US, China and more than 20 other countries in March in an international operation against pirates who have attacked ships in the Gulf of Aden.
As part of its assistance, Japanese officials deployed two destroyers and two maritime surveillance aircraft to the region.
But the destroyers had no mandate to use force except in self-defence.
The military mission is unprecedented for Japan, which imposed constitutional limits to prohibit the use of force to resolve international disputes after the second world war.
But the country's more powerful lower house of parliament voted the bill into law on Friday after the upper house rejected it.
Opposing parliament members said the move could erode the nation's pacifist constitution.
Despite international piracy efforts, the International Maritime Bureau has said that more ships have been attacked off Somalia in the first six months of 2009 than in all of last year.